Queue a button press at the position of the last queued move.
- ui: the UI to queue the event on.
- button: which button went down.
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);
node := find_label(*ui, "Add");
send_mouse_move(*ui, node.rect.x + 2, node.rect.y + 2);
send_mouse_down(*ui);
send_mouse_up(*ui);
frame(*ui, *count, build);
assert(count == 1);send_mouse_down :: (ui: *UI_State, button: Mouse_Button = .LEFT)
Queue a button press at the position of the last queued move.
Parameters
- ui: *UI_State
- the UI to queue the event on.
- button: Mouse_Button = .LEFT
- which button went down.
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);
node := find_label(*ui, "Add");
send_mouse_move(*ui, node.rect.x + 2, node.rect.y + 2);
send_mouse_down(*ui);
send_mouse_up(*ui);
frame(*ui, *count, build);
assert(count == 1);