application/main.c

branch
newapi
changeset 278
a8faf8757450
parent 275
132c7bcc6997
child 279
2ad83650d797
--- a/application/main.c	Sun Apr 07 11:26:38 2024 +0200
+++ b/application/main.c	Sun Apr 07 12:36:07 2024 +0200
@@ -50,7 +50,13 @@
 }
 
 void action_button(UiEvent *event, void *userdata) {
-    
+    ui_dialog(event->obj,
+            .title = "My Title",
+            .button1_label = "OK",
+            .button2_label = "Test",
+            .closebutton_label = "Cancel",
+            .content = "Hello World!",
+            .input = true);
 }
 
 void action_switch(UiEvent *event, void *userdata) {
@@ -98,7 +104,7 @@
     MyDocument *doc = create_doc();
     ui_attach_document(obj->ctx, doc);
     
-    ui_button(obj, .label = "Test Button", .icon = "application-x-generic");
+    ui_button(obj, .label = "Test Button", .icon = "application-x-generic", .onclick = action_button);
     ui_togglebutton(obj, .label = "Toggle");
     ui_checkbox(obj, .label = "Checkbox");
     

mercurial