UI module

column

procedureextensionexperimentalsince 0.31.0Source

A container that lays its children out top to bottom.

Example↗
ui := headless();
defer free_ui(*ui);
frame(*ui, *ui, (u: *UI_State) {
    for column(.{ gap = 10 }) {
        label("top");
        label("bottom");
    }
});
assert(find_label(*ui, "bottom").rect.y > find_label(*ui, "top").rect.y);
column :: (style: Style = .{}, loc := #caller_location) -> Container

A container that lays its children out top to bottom.

Parameters

style: Style = .{}
layout and paint options for the container.
loc := #caller_location
the call site. It identifies the widget from one frame to the next, so leave the default.

Returns

Example↗
ui := headless();
defer free_ui(*ui);
frame(*ui, *ui, (u: *UI_State) {
    for column(.{ gap = 10 }) {
        label("top");
        label("bottom");
    }
});
assert(find_label(*ui, "bottom").rect.y > find_label(*ui, "top").rect.y);

See also