One line of text.
- text: the text to show. It is copied for the frame.
- options: size, colour, font and spacing.
- loc: the call site. It identifies the widget from one frame to the next, so leave the default.
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
- *Node
ui := headless();
defer free_ui(*ui);
frame(*ui, *ui, (u: *UI_State) { label("Hello"); });
assert(find_label(*ui, "Hello") != null);