--- a/make/vs/testapp/main.c Sun Oct 01 16:53:02 2023 +0200 +++ b/make/vs/testapp/main.c Sun Oct 01 17:22:17 2023 +0200 @@ -61,6 +61,10 @@ printf("onchange: %d\n", event->intval); } +void action_switch(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)); @@ -93,6 +97,7 @@ } ui_newline(obj); ui_radiobutton(obj, .label = "Radio 4", .value = wdata->radio); + ui_switch(obj, .label = "test", .onchange=action_switch); } ui_show(obj);