application/main.c

changeset 71
3e021c5f18a0
parent 70
3d801e8dda3a
child 72
a00b46d92c54
equal deleted inserted replaced
70:3d801e8dda3a 71:3e021c5f18a0
82 //printf("name: {%s}\n", ui_getval(name)); 82 //printf("name: {%s}\n", ui_getval(name));
83 //printf("mail: {%s}\n", ui_getval(mail)); 83 //printf("mail: {%s}\n", ui_getval(mail));
84 //ui_select_tab(tabview, 1); 84 //ui_select_tab(tabview, 1);
85 } 85 }
86 86
87 void action_check(UiEvent *event, void *data) {
88 printf("check: %d\n", event->intval);
89 }
90
87 void action_test(UiEvent *event, void *data) { 91 void action_test(UiEvent *event, void *data) {
88 //ui_select_tab(tabview, 0); 92 //ui_select_tab(tabview, 0);
89 } 93 }
90 94
91 int main(int argc, char** argv) { 95 int main(int argc, char** argv) {
96 100
97 101
98 102
99 ui_menu("File"); 103 ui_menu("File");
100 ui_menuitem_st(UI_STOCK_CLOSE, action_close, NULL); 104 ui_menuitem_st(UI_STOCK_CLOSE, action_close, NULL);
105 ui_checkitem("Test", action_check, NULL);
101 //ui_checkitem("Check", action_button, NULL); 106 //ui_checkitem("Check", action_button, NULL);
102 107
103 ui_toolitem_st("button", UI_STOCK_GO_BACK, action_button, NULL); 108 ui_toolitem_st("button", UI_STOCK_GO_BACK, action_button, NULL);
104 ui_toolbar_add_default("button"); 109 ui_toolbar_add_default("button");
105 110
106 printf("create window\n"); 111 printf("create window\n");
107 UiObject *window = ui_window("Mod0", NULL); 112 UiObject *window = ui_window("Mod0", NULL);
108 113
109 ui_grid(window);
110
111 ui_label(window, "Name");
112 ui_textfield(window, &name);
113 ui_newline(window);
114
115 ui_label(window, "Email");
116 ui_textfield(window, &mail);
117
118
119 ui_end(window);
120 114
121 115
122 ui_show(window); 116 ui_show(window);
123 ui_main(); 117 ui_main();
124 118

mercurial