488 |
488 |
489 void action_button(UiEvent *event, void *data) { |
489 void action_button(UiEvent *event, void *data) { |
490 printf("action_button\n"); |
490 printf("action_button\n"); |
491 } |
491 } |
492 |
492 |
|
493 typedef struct WData { |
|
494 UiString *path; |
|
495 } WData; |
|
496 |
493 void application_startup(UiEvent *event, void *data) { |
497 void application_startup(UiEvent *event, void *data) { |
494 UiObject *obj = ui_window("Test", NULL); |
498 UiObject *obj = ui_window("Test", NULL); |
495 |
499 |
|
500 WData *wdata = ui_malloc(obj->ctx, sizeof(WData)); |
|
501 wdata->path = ui_string_new(obj->ctx, NULL); |
|
502 obj->window = wdata; |
|
503 |
|
504 /* |
496 ui_grid(obj, .margin = 10) { |
505 ui_grid(obj, .margin = 10) { |
497 ui_button(obj, .label = "Test Button", .onclick = action_button); |
506 ui_button(obj, .label = "Test Button", .onclick = action_button); |
498 ui_newline(obj); |
507 ui_newline(obj); |
499 |
508 |
500 ui_togglebutton(obj, .label = "Togglebutton"); |
509 ui_togglebutton(obj, .label = "Togglebutton"); |