Suppose you want to have a context menu on a button, it works like that:
Code: Select all
<button contextmenu="id_of_context_menu" notify="contextmenutrigger" id="button_1">Test</button>
Whenever the user selects an item from the context menu, your event callback will be called with msg.ID set to the ID of the button ("button_1") and msg.TriggerValue set to the ID of the menu item that has been selected.
BIG PROBLEM: I've just realized that there's a bug in MUI Royale 1.0 which prevents msg.TriggerValue from getting the ID of the selected menu item. I'll fix this for the next version.