2.4. Layout helpers — splits, columns, docking, spacing
Stateful layout helpers — splits, columns, and a fixed-orientation sidebar —
plus thin wrappers around ImGui’s column primitives. split_h / split_v
divide the available region between two BeginChild panes separated by a
draggable handle, with the split ratio persisted in SliderStateFloat.
dock_left is a stable-position left sidebar (not real docking — that lives
in imgui_internal.h and is off-limits) with a draggable right edge. The
columns(N, ${col0}, ${col1}, …) call_macro expands to
columns_open(N) / next_col() / columns_close() with one block
literal per column, so the column count must match the block-arg count
statically.
2.4.1. Call macros
- columns
Function annotation columns
- split_v
Function annotation split_v
- dock_left
Function annotation dock_left
- split_h
Function annotation split_h
2.4.2. Columns
- columns_close()
Close a columns block (return to single-column layout). Underlying primitive emitted by the columns(N, …) call_macro.
- columns_open(n: int; id: string = ""; border: bool = true )
Open an N-column block. id (default empty) is the ImGui id-stack
tag used for column-width persistence; border (default on) draws
the vertical dividers. Primitive emitted by the columns(N, …)
call_macro; callable directly when the column count or shape is
dynamic.
- Arguments:
n : int
id : string
border : bool
- next_col()
Advance to the next column. Underlying primitive emitted by the columns(N, …) call_macro.
2.4.3. Trees
- tree_node_open(text: string; flags: ImGuiTreeNodeFlags = imgui::ImGuiTreeNodeFlags.None ): bool
TreeNodeEx(label, flags) : bool — open form WITHOUT auto-pair TreePop.
Use when the body needs to render outside the conditional (e.g.
same_line() immediately after the header trigger). Caller MUST
invoke tree_pop() when the return value is true AND the
NoTreePushOnOpen flag was NOT set (passing that flag skips the
TreePush, so a matching TreePop would underflow the stack).
- Arguments:
text : string
flags : ImGuiTreeNodeFlags
- tree_pop()
Pair with tree_node_open (or the leaf-bool TreeNodeEx overload) when the return value is true AND the NoTreePushOnOpen flag was NOT set. The tree_node container auto-pairs TreePop; this wrapper covers the manual case.
2.4.4. List clipping
- list_clipper(items_count: int; body: block<(start:int;end_:int):void> )
Cull a virtual list of items_count items to the visible region. The block fires once per visible chunk with [start, end_) indices; render exactly those rows inside the block.
- Arguments:
items_count : int
body : block<(start:int;end_:int):void>