application/main.c

branch
newapi
changeset 417
f0fee61a70be
parent 416
89ad8467c39f
child 419
7d15cad351fc
equal deleted inserted replaced
416:89ad8467c39f 417:f0fee61a70be
549 549
550 550
551 ui_show(obj); 551 ui_show(obj);
552 } 552 }
553 553
554 void action_test(UiEvent *event, void *data) {
555 printf("action test\n");
556 }
557
554 int main(int argc, char** argv) { 558 int main(int argc, char** argv) {
555 ui_init("app1", argc, argv); 559 ui_init("app1", argc, argv);
556 ui_onstartup(application_startup, NULL); 560 ui_onstartup(application_startup, NULL);
557 561
558 // menu 562 // menu
559 ui_menu("File") { 563 ui_menu("File") {
560 ui_menuitem(.label = "Test"); 564 ui_menuitem(.label = "Test 1", .onclick = action_test);
565 ui_menuitem(.label = "Test 2", .onclick = action_test);
566 ui_menuitem(.label = "Test 3", .onclick = action_test);
561 } 567 }
562 568
563 ui_main(); 569 ui_main();
564 return (EXIT_SUCCESS); 570 return (EXIT_SUCCESS);
565 } 571 }

mercurial