make/vs/testapp/main.c

branch
newapi
changeset 250
d2068517fbdd
parent 235
9c79f00fbf36
child 252
7d176764756d
--- a/make/vs/testapp/main.c	Fri Feb 09 16:52:11 2024 +0100
+++ b/make/vs/testapp/main.c	Sun Feb 11 12:29:30 2024 +0100
@@ -184,6 +184,15 @@
 
 }
 
+void dialog_result(UiEvent *evt, void *data) {
+    printf("dialog: %d\n", (int)evt->intval);
+}
+
+void btn_dialog(UiEvent *evt, void *data) {
+    ui_dialog(evt->obj, .title = "Title", .content = "Hello World", .button1_label = "Yes", .button2_label = "No", .closebutton_label = "Close", .result = dialog_result);
+}
+
+
 
 
 void application_startup(UiEvent* event, void* data) {
@@ -268,7 +277,7 @@
             ui_button(obj, .icon = "Forward", .onclick = action1, .onclickdata = "action3", .hexpand = true);
             ui_newline(obj);
 
-            ui_button(obj, .label = "Button4", .onclick = action1, .onclickdata = "action4");
+            ui_button(obj, .label = "Dialog Test", .onclick = btn_dialog, .onclickdata = "action4");
             ui_button(obj, .label = "Button5", .onclick = action1, .onclickdata = "action5", .colspan = 2);
             ui_newline(obj);
 

mercurial