UI module

Split

structextensionexperimentalsince 0.31.0Source

An open split: the two panes are visited with for pane: split(...).

Example↗
width := 150.0;
ui := headless(.{ width = 400, height = 200 });
defer free_ui(*ui);
frame(*ui, *width, (w: *float) {
    for pane: split(.HORIZONTAL, w) {
        if pane == 0 label("left pane");
        else label("right pane");
    }
});
assert(find_label(*ui, "left pane") != null);

Fields

node: *Node
position: *float
axis: Axis
min_size: float

See also