GUI Menu
App: apps/gui_menu/
Demonstrates a full menubar (File/Edit) with separators and symbol+label items, plus a right-click contextual menu. All selected items are logged to an on-screen log list.
Run from root
Section titled “Run from root”% ./plume3d gui_menuWhat it shows
Section titled “What it shows”- Menubar (
menubarBegin/menubarEnd) wrappingmenuBeginLabelentries. - File menu — New, Open, Save, separator, Exit.
- Edit menu — items with symbol+label (
menuItemSymbolLabel). - Right-click contextual (
contextualBegin) — opens on right-click anywhere in the window; items: Copy, Cut, Paste, Delete. - On-screen log of the last 20 actions.
Key patterns
Section titled “Key patterns”Gui.menubarBegin()// align=17 (0x11 = NK_TEXT_LEFT)if (Gui.menuBeginLabel("File", 17, 120, 200)) { Gui.layoutRowDynamic(25, 1) if (Gui.menuItemLabel("New", 17)) addLog("File > New") if (Gui.menuItemLabel("Open", 17)) addLog("File > Open") Gui.separator(128, 128, 128, 60, true) if (Gui.menuItemLabel("Exit", 17)) addLog("File > Exit") Gui.menuEnd()}Gui.menubarEnd()
// Right-click contextualif (Gui.contextualBegin(0, 150, 200, 0, 0, w, h)) { Gui.layoutRowDynamic(25, 1) if (Gui.contextualItemLabel("Copy", 17)) addLog("Copy") if (Gui.contextualItemLabel("Delete", 17)) addLog("Delete") Gui.contextualEnd()}