application/main.c

changeset 1137
db9c3838fd4d
parent 1129
a4affe75198c
--- a/application/main.c	Sat May 23 21:38:30 2026 +0200
+++ b/application/main.c	Sun May 24 08:53:45 2026 +0200
@@ -642,6 +642,21 @@
     printf("global save\n");
 }
 
+static void action_test_dialog_onclick(UiEvent *event, void *userdata) {
+    ui_close(event->obj);
+}
+
+static void action_test_dialog(UiEvent *event, void *userdata) {
+    UiObject *obj = ui_dialog_window(event->obj, .title = "Test Dialog", .lbutton1 = "OK", .rbutton4 = "Cancel", .onclick = action_test_dialog_onclick);
+    ui_vbox(obj, .margin = 10, .spacing = 10) {
+        ui_button(obj, .label = "Test 1");
+        ui_button(obj, .label = "Test 2");
+        ui_button(obj, .label = "Test 3");
+        ui_button(obj, .label = "Test 4");
+    }
+    ui_show(obj);
+}
+
 void application_startup(UiEvent *event, void *data) {
     // test window destruction
     UiObject *testobj = ui_window("testwindow");
@@ -759,6 +774,7 @@
             ui_button(obj, .label = "Obj Unref", .onclick=action_button_unref, .onclickdata = obj);
             ui_button(obj, .label = "Button 5", .onclick=action_tab2_button);
             ui_button(obj, .label = "Button 6", .onclick=action_tab2_button);
+            ui_button(obj, .label = "Test Dialog", .onclick=action_test_dialog);
         }
         ui_tab(obj, "Tab 3") {
             UiTabViewArgs args = {.fill = TRUE};

mercurial