UI module

row

procedureextensionexperimentalsince 0.31.0Source

A container that lays its children out left to right.

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

A container that lays its children out left to right.

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 row(.{ gap = 10 }) {
        label("left");
        label("right");
    }
});
assert(find_label(*ui, "right").rect.x > find_label(*ui, "left").rect.x);

See also