GUI Popup
App: apps/gui_popup/
Demonstrates Nuklear’s popup and tooltip systems: a modal static popup (confirm dialog), a non-modal dynamic popup, and both simple and custom-content tooltips.
Run from root
Section titled “Run from root”% ./plume3d gui_popupWhat it shows
Section titled “What it shows”- Static popup (modal) — opened by a button; contains OK/Cancel. Blocks interaction with the rest of the window until dismissed.
type=0. - Dynamic popup (non-modal) — floats above content without blocking.
type=1. - Simple tooltip (
tooltip(text)) — shown on hover usingisWidgetHovered(). - Custom tooltip (
tooltipBegin/tooltipEnd) — allows arbitrary widget content inside the tooltip.
Key patterns
Section titled “Key patterns”// Open a modal popupif (Gui.buttonLabel("Show Confirm")) _showPopup = true
if (_showPopup) { // type=0 (static/modal), flags=268 (title+border+closable) if (Gui.popupBegin(0, "Confirm", 268, 150, 100, 250, 150)) { Gui.layoutRowDynamic(22, 1) Gui.label("Are you sure?") Gui.layoutRowDynamic(32, 2) if (Gui.buttonLabel("OK")) { _showPopup = false Gui.popupClose() } if (Gui.buttonLabel("Cancel")) { _showPopup = false Gui.popupClose() } Gui.popupEnd() } else { _showPopup = false // closed via X button }}
// Hover tooltipGui.buttonLabel("Hover me")if (Gui.isWidgetHovered()) { Gui.tooltip("This is a tooltip!")}