The first node with this label.
- ui: the UI to search.
- label: the label to match exactly.
ui := headless(.{ width = 320, height = 200 });
defer free_ui(*ui);
count := 0;
build := (n: *int) {
for column(.{ gap = 8, padding = 16 }) {
label(tprint("Clicked % times", n.*));
if button("Add") n.* += 1;
}
};
frame(*ui, *count, build);
assert(find_label(*ui, "Add") != null);
assert(find_label(*ui, "Remove") == null);find_label :: (ui: *UI_State, label: string) -> *Node
The first node with this label.
Parameters
- ui: *UI_State
- the UI to search.
- label: string
- the label to match exactly.
Returns
- *Node
ui := headless(.{ width = 320, height = 200 });
defer free_ui(*ui);
count := 0;
build := (n: *int) {
for column(.{ gap = 8, padding = 16 }) {
label(tprint("Clicked % times", n.*));
if button("Add") n.* += 1;
}
};
frame(*ui, *count, build);
assert(find_label(*ui, "Add") != null);
assert(find_label(*ui, "Remove") == null);