--- a/application/main.c Wed Dec 04 08:57:35 2024 +0100 +++ b/application/main.c Wed Dec 04 18:31:22 2024 +0100 @@ -34,7 +34,7 @@ #include <cx/buffer.h> #include <cx/utils.h> -#ifndef UI_COCOA +#if !defined(UI_COCOA) && !defined(UI_MOTIF) typedef struct { UiString *str1; @@ -455,10 +455,22 @@ #endif -#ifdef UI_COCOA +#if defined(UI_COCOA) || defined(UI_MOTIF) + +void action_button(UiEvent *event, void *data) { + printf("action_button\n"); +} void application_startup(UiEvent *event, void *data) { - + UiObject *obj = ui_window("Test", NULL); + ui_button(obj, .label = "Test Button", .onclick = action_button); + ui_togglebutton(obj, .label = "Togglebutton"); + ui_checkbox(obj, .label = "Checkbox", .enable_group = 123); + ui_checkbox(obj, .label = "Checkbox Disabled", .groups = UI_GROUPS(123)); + ui_radiobutton(obj, .label = "Radio 1", .varname = "radio"); + ui_radiobutton(obj, .label = "Radio 2", .varname = "radio"); + + ui_show(obj); } int main(int argc, char** argv) {