When an item is selected in a submenu within a ContextMenu two notifications are triggered (though only the first one includes the "Parent" item in the event message).
Here is some test code:
Code: Select all
@REQUIRE "RapaGUI"
EnableLayers()
AppGUI$=[[<application id="app">
<menu title="Test Menu" id="Menu">
<item id="Cut">Cut</item>
<item id="Copy">Copy</item>
<item id="Paste">Paste</item>
<menu title="Edit">
<item id="Cut2">Cut</item>
<item id="Copy2">Copy</item>
<item id="Paste2">Paste</item>
</menu>
</menu>
<window id="Main" Title="Test">
<vgroup>
<hollywood display="1" fixwidth="true" fixheight="true" contextmenu="Menu"/>
</vgroup>
</window>
</application>]]
moai.CreateApp(AppGUI$)
Function p_TestFunc(msg)
DebugPrint(msg.id)
EndFunction
InstallEventHandler({RapaGUI=p_TestFunc})
Repeat
WaitEvent
Forever