UI module

end_frame

procedureextensionexperimentalsince 0.31.0Source

Finish the frame: drop nodes nobody declared, lay the tree out and fix focus.

Example↗
ui := headless(.{ width = 200, height = 100 });
defer free_ui(*ui);
push_ui(*ui);
begin_frame(*ui);
button("OK");
end_frame(*ui);
pop_ui();
assert(find_label(*ui, "OK").rect.w > 0);
end_frame :: (ui: *UI_State)

Finish the frame: drop nodes nobody declared, lay the tree out and fix focus.

Parameters

ui: *UI_State
the UI whose frame is done.
Example↗
ui := headless(.{ width = 200, height = 100 });
defer free_ui(*ui);
push_ui(*ui);
begin_frame(*ui);
button("OK");
end_frame(*ui);
pop_ui();
assert(find_label(*ui, "OK").rect.w > 0);

See also