aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/main.c b/tests/main.c
index 79afbea..5f07558 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -9,16 +9,19 @@ int main() {
return 1;
mgl_window window;
- if(mgl_window_create(&window, "mgl", &(mgl_window_create_params){ .size = {1280, 720} }) != 0)
+ if(mgl_window_create(&window, "mgl", &(mgl_window_create_params){ .size = { 1280, 720 } }) != 0)
return 1;
- mgui_list *list = mgui_list_create(MGUI_LIST_VERTICAL);
+ mgui_list *list = mgui_list_create(MGUI_LIST_VERTICAL, (mgl_vec2i){ 1280, 720 });
mgui_list_append(list, mgui_button_to_widget(mgui_button_create()));
mgui_list_append(list, mgui_button_to_widget(mgui_button_create()));
mgl_event event;
while(mgl_window_is_open(&window)) {
while(mgl_window_poll_event(&window, &event)) {
+ if(event.type == MGL_EVENT_RESIZED) {
+ mgui_list_set_size(list, (mgl_vec2i){ event.size.width, event.size.height });
+ }
mgui_list_on_event(list, &window, &event);
}