Skip to content

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.

Terminal window
% ./plume3d gui_popup
  • 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 using isWidgetHovered().
  • Custom tooltip (tooltipBegin / tooltipEnd) — allows arbitrary widget content inside the tooltip.
// Open a modal popup
if (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 tooltip
Gui.buttonLabel("Hover me")
if (Gui.isWidgetHovered()) {
Gui.tooltip("This is a tooltip!")
}
  • GuipopupBegin, popupClose, popupEnd, popupGetScroll.
  • Guitooltip, tooltipBegin, tooltipEnd.
  • GuiisWidgetHovered.