Small docs improvement concerning MenuItems

Discuss GUI programming with the RapaGUI plugin here
Post Reply
User avatar
mrupp
Posts: 147
Joined: Sun Jan 31, 2021 7:44 pm
Location: Switzerland
Contact:

Small docs improvement concerning MenuItems

Post by mrupp »

Hi there

For my application, I'm implementing context menus. So I was following the example described here:
Chapter 3.16: https://www.hollywood-mal.com/docs/html ... Menus.html

Code: Select all

<menu title="Context menu" id="ctxtmenu">
   <item>Cut</item>
   <item>Copy</item>
   <item>Paste</item>
</menu>

<window>
...
   <texteditor contextmenu="ctxtmenu"/>
...
</window>
But I was wondering why I didn't receive any notifications when clicking a menuitem. I added the notify="selected" attribute and then it was working. Still, the docs clearly say that this should not be necessary, and that got me puzzled.

Only a day later I realized my very silly mistake: The notifications (without stating notify="selected") work as soon as the menuitems have IDs, which of course makes totally sense.

Still, it might save some time to others (as it would have for me) to change the example above to the following:

Code: Select all

<menu title="Context menu" id="ctxtmenu">
   <item id="mni_cut">Cut</item>
   <item id="mni_copy">Copy</item>
   <item id="mni_paste">Paste</item>
</menu>

<window>
...
   <texteditor contextmenu="ctxtmenu"/>
...
</window>
(or similar)

The same example can also be found here:
Chapter 30.1: https://www.hollywood-mal.com/docs/html ... /Menu.html

Cheers,
Michael
User avatar
airsoftsoftwair
Posts: 5450
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Small docs improvement concerning MenuItems

Post by airsoftsoftwair »

mrupp wrote: Sun Mar 03, 2024 1:36 pm Still, it might save some time to others (as it would have for me) to change the example above to the following:
Yes, makes sense, I've just changed that.
Post Reply