Working with Menus
You can create menus using the <menubar> and <menuitem> elements. Menus can be create on menubars, as shortcut menus, and as dropdown menus.
A <menuitem> can execute the ACL command specified in its command parameter, or the actions defined in its child <script> element using menuselected and menupost event listeners. The menuselected listener can contain the command for the menu item. The menupost listener can disable the menu item when certain conditions are met. Listeners can also be registered for the same events on items within a shortcut or dropdown menu. The posting of a menu for either a menubar or a control will cause the event ITEM_POSTMENU to be dispatched. The selection of an item will cause the existing ITEM_CHANGED event to be dispatched.