GUI Layout
App: apps/gui_layout/
Demonstrates every Nuklear layout system in one window, with labeled sections and buttons to make column widths visible.
Run from root
Section titled “Run from root”% ./plume3d gui_layoutWhat it shows
Section titled “What it shows”| Layout type | Method(s) |
|---|---|
| Dynamic (equal columns) | layoutRowDynamic(height, cols) |
| Static (fixed-width columns) | layoutRowStatic(height, itemWidth, cols) |
| Manual row (ratio or pixel) | layoutRowBegin / layoutRowPush / layoutRowEnd |
| Template (mixed column types) | layoutRowTemplateBegin / Push* / End |
| Space (absolute rects) | layoutSpaceBegin / layoutSpacePush / layoutSpaceEnd |
| Groups (scrollable sub-region) | beginGroup / endGroup |
Key patterns
Section titled “Key patterns”// Ratio columns (30% label + 70% edit)Gui.layoutRowBegin(1, 30, 2) // format=1 (ratio)Gui.layoutRowPush(0.3)Gui.label("Name:")Gui.layoutRowPush(0.7)_name = Gui.editString(_name, 64)Gui.layoutRowEnd()
// Template: one dynamic + one static columnGui.layoutRowTemplateBegin(30)Gui.layoutRowTemplatePushDynamic()Gui.layoutRowTemplatePushStatic(80)Gui.layoutRowTemplateEnd()
// Space layout (absolute position within a 200-high region)Gui.layoutSpaceBegin(0, 200, 3) // format=0 (static)Gui.layoutSpacePush(10, 10, 80, 30)Gui.buttonLabel("A")Gui.layoutSpacePush(100, 50, 80, 30)Gui.buttonLabel("B")Gui.layoutSpaceEnd()
// Scrollable groupif (Gui.beginGroup("Items", 0)) { for (i in 0...20) { Gui.layoutRowDynamic(20, 1) Gui.label("Item %(i)") } Gui.endGroup()}