Skip to content

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.

Terminal window
% ./plume3d gui_menu
  • Menubar (menubarBegin / menubarEnd) wrapping menuBeginLabel entries.
  • 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.
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 contextual
if (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()
}
  • GuimenubarBegin/End, menuBeginLabel, menuItemLabel, menuItemSymbolLabel, menuClose, menuEnd.
  • GuicontextualBegin, contextualItemLabel, contextualEnd.