RecurLoop/ Documentation
Gui/Guidesv0.2.12

Layouts

Compose and attach containers

column and row create boxes with spacing in pixels. append(box, child, grow, padding) attaches a child at the start; append_end packs it at the end. grow controls expansion and padding adds surrounding space.

recurloop
import gui
let build_form = fn () -> u8* {
    let root = Gui:column(12)
    if !root { return cast(u8*, 0) }
    let actions = Gui:row(8)
    Gui:append(root, Gui:input("Package name"), 0, 0)
    Gui:append(actions, Gui:button("Cancel"), 0, 0)
    Gui:append_end(actions, Gui:button("Save"), 0, 0)
    Gui:append(root, actions, 0, 0)
    return root
}

Transfer the root to its parent

Call this after successful initialization. The returned root belongs to the caller until attached to another container. Destroying that root releases its attached children; do not separately free a child pointer after attachment.

Select a container for the job

ContainerPurposeSelection API
row / columnhorizontal / vertical layoutno active child
horizontal / vertical splituser-resizable pairsplit_first, split_second, split_position
tabsnamed pagestabs_select with zero-based index
stackone visible childstack_select with child pointer
scrollscrolling contentchild supplied to scroll

Use expansion and alignment separately: expansion requests extra space; alignment positions a widget within its allocation. size requests a minimum size, with -1 leaving a dimension to the toolkit. Read allocated dimensions only after layout when actual pixel size matters.