461 printf("action_button\n"); |
461 printf("action_button\n"); |
462 } |
462 } |
463 |
463 |
464 void application_startup(UiEvent *event, void *data) { |
464 void application_startup(UiEvent *event, void *data) { |
465 UiObject *obj = ui_window("Test", NULL); |
465 UiObject *obj = ui_window("Test", NULL); |
466 ui_button(obj, .label = "Test Button", .onclick = action_button); |
466 |
467 ui_togglebutton(obj, .label = "Togglebutton"); |
467 ui_grid(obj, .margin = 10) { |
468 ui_checkbox(obj, .label = "Checkbox", .enable_group = 123); |
468 ui_button(obj, .label = "Test Button", .onclick = action_button); |
469 ui_checkbox(obj, .label = "Checkbox Disabled", .groups = UI_GROUPS(123)); |
469 ui_newline(obj); |
470 ui_radiobutton(obj, .label = "Radio 1", .varname = "radio"); |
470 |
471 ui_radiobutton(obj, .label = "Radio 2", .varname = "radio"); |
471 ui_togglebutton(obj, .label = "Togglebutton"); |
|
472 ui_togglebutton(obj, .label = "XY", .hfill = TRUE); |
|
473 ui_togglebutton(obj, .label = "AB", .hfill = TRUE); |
|
474 ui_togglebutton(obj, .label = "ZZ", .hexpand = TRUE, .hfill = TRUE); |
|
475 ui_newline(obj); |
|
476 |
|
477 ui_hbox(obj, .colspan = 2) { |
|
478 ui_checkbox(obj, .label = "Checkbox", .enable_group = 123); |
|
479 ui_checkbox(obj, .label = "Checkbox Disabled", .groups = UI_GROUPS(123)); |
|
480 } |
|
481 ui_newline(obj); |
|
482 |
|
483 |
|
484 ui_hbox(obj, .colspan = 4) { |
|
485 ui_radiobutton(obj, .label = "Radio 1", .varname = "radio"); |
|
486 ui_radiobutton(obj, .label = "Radio 2", .varname = "radio"); |
|
487 } |
|
488 ui_newline(obj); |
|
489 |
|
490 ui_hbox(obj, .vexpand = TRUE, .vfill = TRUE) { |
|
491 ui_button(obj, .label = "F1"); |
|
492 ui_button(obj, .label = "F2"); |
|
493 ui_button(obj, .label = "F3"); |
|
494 } |
|
495 |
|
496 } |
|
497 |
|
498 |
|
499 |
472 |
500 |
473 ui_show(obj); |
501 ui_show(obj); |
474 } |
502 } |
475 |
503 |
476 int main(int argc, char** argv) { |
504 int main(int argc, char** argv) { |