UXMenu
UXMenu is one titled menu of a
UXMenuBar: a list of
UXMenuItems and separators, built in
display order before the bar’s install. Like every menu class it draws
nothing and tracks nothing; the platform does both.
UXMenu* edit = bar.addMenu((u8*)" Edit ");edit.addItem((u8*)" Cut ", &controller.onCut);edit.addItem((u8*)" Copy ", &controller.onCopy);edit.addSeparator();edit.addItem((u8*)" Select All ", &controller.onSelectAll);Topics
Section titled “Topics”addItem
Section titled “addItem”UXMenuItem* addItem(u8* t, callback a void(UXMenuItem* sender))Appends an item with its callback action and returns it, so initial state
(checked, enabled) can be set before install. The callback ensures a menu
never owns its controller.
addSeparator
Section titled “addSeparator”void addSeparator(void)Appends a separator rule. Separators never fire.
bool popUp(i32 window, i32 x, i32 y)Shows the menu as a context menu at point (x, y) of the window’s content and fires the item picked. Returns false when the menu is dismissed, or when the backend has no pop-up menus. From 0.7 on AppKit, and on GTK and Windows from 0.71.