Skip to content

GUI Window

App: apps/gui_window/

A two-panel demo: a Control Panel (left) lets you toggle every Nuklear window flag and programmatically show/hide/collapse a Target Window (right). Demonstrates the full windowSetBounds, windowShow, windowCollapse, isWindowHovered, and widget-disable APIs.

Terminal window
% ./plume3d gui_window
  • Window flags — checkboxes for every NK_WINDOW_* flag: Border, Movable, Scalable, Closable, Minimizable, NoScrollbar, Title. Applied via beginWindowEx(name, title, x, y, w, h, flags).
  • Show/HidewindowShow(name, state) (1 = show, 0 = hide).
  • Collapse/ExpandwindowCollapse(name, state) (1 = collapsed, 0 = expanded).
  • Set boundswindowSetBounds(name, x, y, w, h) to reposition the window in code.
  • Is hoveredisWindowHovered() and isAnyWindowHovered().
  • Widget disablewidgetDisableBegin() / widgetDisableEnd() greys out a group of widgets.
// Open window with explicit flags bitmask
Gui.beginWindowEx("Target", "Target Window", 400, 20, 340, 400, _flags)
// ...content...
Gui.endWindow()
// Programmatic control
if (Gui.buttonLabel("Hide")) Gui.windowShow("Target", 0)
if (Gui.buttonLabel("Show")) Gui.windowShow("Target", 1)
if (Gui.buttonLabel("Collapse")) Gui.windowCollapse("Target", 1)
if (Gui.buttonLabel("Expand")) Gui.windowCollapse("Target", 0)
if (Gui.buttonLabel("Reset bounds")) {
Gui.windowSetBounds("Target", 400, 20, 340, 400)
}
// Widget disable
_disableWidgets = Gui.checkbox("Disable widgets below", _disableWidgets)
if (_disableWidgets) Gui.widgetDisableBegin()
Gui.buttonLabel("This is disabled")
_val = Gui.sliderFloat(0, _val, 1, 0.01)
if (_disableWidgets) Gui.widgetDisableEnd()
FlagValueEffect
Border1Draw window border
Movable2User can drag
Scalable4User can resize
Closable8Shows close button
Minimizable16Shows minimize button
NoScrollbar32Hide scrollbar
Title64Show title bar
  • GuibeginWindowEx, windowShow, windowCollapse, windowSetBounds, windowSetPosition, isWindowHovered, isAnyWindowHovered.
  • GuiwidgetDisableBegin, widgetDisableEnd.