make/vs/testapp/main.c

branch
newapi
changeset 189
4daddc326877
parent 188
fbbae6738252
child 190
70fd1b24e395
--- a/make/vs/testapp/main.c	Sun Oct 01 14:40:43 2023 +0200
+++ b/make/vs/testapp/main.c	Sun Oct 01 16:39:03 2023 +0200
@@ -57,6 +57,10 @@
     wdata->check->set(wdata->check, 1);
 }
 
+void action_onchange(UiEvent* event, void* data) {
+    printf("onchange: %d\n", event->intval);
+}
+
 void application_startup(UiEvent* event, void* data) {
     UiObject* obj = ui_window("Test", NULL);
     WindowData* wdata = ui_malloc(obj->ctx, sizeof(WindowData));
@@ -78,17 +82,18 @@
         ui_button(obj, .label="Very Long Button Label Text ____________ Test", .onclick=action_set_checkbox);
         ui_newline(obj);
 
-        ui_checkbox(obj, .label = "Option 1", .value = wdata->check);
+        ui_checkbox(obj, .label = "Option 1", .value = wdata->check, .onchange=action_onchange);
         ui_togglebutton(obj, .label = "Option 2", .value = wdata->toggle);
         ui_newline(obj);
 
         ui_layout_colspan(obj, 3);
-        ui_layout_fill(obj, FALSE);
         UI_HBOX(obj) {
             ui_radiobutton(obj, .label = "Radio 1", .value = wdata->radio);
             ui_radiobutton(obj, .label = "Radio 2", .value = wdata->radio);
             ui_radiobutton(obj, .label = "Radio 3", .value = wdata->radio);
         }
+        ui_newline(obj);
+        ui_radiobutton(obj, .label = "Radio 4", .value = wdata->radio);
     }
 
     ui_show(obj);

mercurial