The tree as indented text: role, label or text, and the rectangle of each node. Useful as a snapshot of a layout.
- ui: the UI to dump.
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);
dump := layout_dump(*ui);
assert(dump.count > 0);
print("%", dump);layout_dump :: (ui: *UI_State) -> string
The tree as indented text: role, label or text, and the rectangle of each node. Useful as a snapshot of a layout.
Parameters
- ui: *UI_State
- the UI to dump.
Returns
- string
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);
dump := layout_dump(*ui);
assert(dump.count > 0);
print("%", dump);