UI module

label

procedureextensionexperimentalsince 0.31.0Source

One line of text.

Example↗
ui := headless();
defer free_ui(*ui);
frame(*ui, *ui, (u: *UI_State) { label("Hello"); });
assert(find_label(*ui, "Hello") != null);
label :: (
    text: string,
    options: Text_Options = .{},
    loc := #caller_location
) -> *Node

One line of text.

Parameters

text: string
the text to show. It is copied for the frame.
options: Text_Options = .{}
size, colour, font and spacing.
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) { label("Hello"); });
assert(find_label(*ui, "Hello") != null);

See also