UI module

stack

procedureextensionexperimentalsince 0.31.0Source

A container whose children overlap, each filling it (or placed by align).

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

A container whose children overlap, each filling it (or placed by align).

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 stack() {
        label("under");
        label("over");
    }
});
assert(find_label(*ui, "under").rect.y == find_label(*ui, "over").rect.y);

See also