453 return (EXIT_SUCCESS); |
453 return (EXIT_SUCCESS); |
454 } |
454 } |
455 |
455 |
456 #endif |
456 #endif |
457 |
457 |
458 #ifdef UI_COCOA |
458 #if defined(UI_COCOA) || defined(UI_MOTIF) |
|
459 |
|
460 void action_button(UiEvent *event, void *data) { |
|
461 printf("action_button\n"); |
|
462 } |
459 |
463 |
460 void application_startup(UiEvent *event, void *data) { |
464 void application_startup(UiEvent *event, void *data) { |
461 |
465 UiObject *obj = ui_window("Test", NULL); |
|
466 ui_button(obj, .label = "Test Button", .onclick = action_button); |
|
467 ui_togglebutton(obj, .label = "Togglebutton"); |
|
468 ui_checkbox(obj, .label = "Checkbox", .enable_group = 123); |
|
469 ui_checkbox(obj, .label = "Checkbox Disabled", .groups = UI_GROUPS(123)); |
|
470 ui_radiobutton(obj, .label = "Radio 1", .varname = "radio"); |
|
471 ui_radiobutton(obj, .label = "Radio 2", .varname = "radio"); |
|
472 |
|
473 ui_show(obj); |
462 } |
474 } |
463 |
475 |
464 int main(int argc, char** argv) { |
476 int main(int argc, char** argv) { |
465 ui_init("app1", argc, argv); |
477 ui_init("app1", argc, argv); |
466 ui_onstartup(application_startup, NULL); |
478 ui_onstartup(application_startup, NULL); |