GUI Tree
App: apps/gui_tree/
Demonstrates the two Nuklear tree types: node (collapsible folder-style) and tab (tab-style header). Trees can be nested to arbitrary depth.
Run from root
Section titled “Run from root”% ./plume3d gui_treeWhat it shows
Section titled “What it shows”- Tree node (
type=0=NK_TREE_NODE) — file-system-style collapsible sections. State1= initially open,0= initially collapsed. - Tree tab (
type=1=NK_TREE_TAB) — visually flat, tab-style header; used for settings panels or tabbed content areas. - Nested trees (sub-folders) using recursive
treePush.
Key patterns
Section titled “Key patterns”// Node tree (folder style)if (Gui.treePush(0, "Root", 1)) { // type=0, starts open if (Gui.treePush(0, "Folder1", 1)) { Gui.layoutRowDynamic(20, 1) Gui.label(" File1.txt") Gui.label(" File2.txt") Gui.treePop() } if (Gui.treePush(0, "Folder2", 0)) { // starts collapsed Gui.layoutRowDynamic(20, 1) Gui.label(" File3.txt") Gui.treePop() } Gui.treePop()}
// Tab tree (settings panel style)if (Gui.treePush(1, "Graphics Settings", 1)) { // type=1 _fullscreen = Gui.checkbox("Fullscreen", _fullscreen) _shadows = Gui.checkbox("Shadows", _shadows) Gui.treePop()}Rule: always pop
Section titled “Rule: always pop”treePop() must be called if and only if treePush returned true. Never pop when it returned false.
- Gui —
treePush,treePop.