application/main.c

changeset 68
bd9fb6476b80
parent 67
f72c4f01bf4a
child 69
419c8c3209e8
equal deleted inserted replaced
67:f72c4f01bf4a 68:bd9fb6476b80
78 printf("button: %d\n", event->intval); 78 printf("button: %d\n", event->intval);
79 char *s = ui_gettext(event->obj, "text"); 79 char *s = ui_gettext(event->obj, "text");
80 printf("{%s}\n", s); 80 printf("{%s}\n", s);
81 //printf("name: {%s}\n", ui_getval(name)); 81 //printf("name: {%s}\n", ui_getval(name));
82 //printf("mail: {%s}\n", ui_getval(mail)); 82 //printf("mail: {%s}\n", ui_getval(mail));
83 //ui_select_tab(tabview, 0); 83 ui_select_tab(tabview, 1);
84 } 84 }
85 85
86 void action_test(UiEvent *event, void *data) { 86 void action_test(UiEvent *event, void *data) {
87 //ui_select_tab(tabview, 1); 87 ui_select_tab(tabview, 0);
88 } 88 }
89 89
90 int main(int argc, char** argv) { 90 int main(int argc, char** argv) {
91 ui_init("app1", argc, argv); 91 ui_init("app1", argc, argv);
92 ui_locales_dir("/opt/app1/locales"); 92 ui_locales_dir("/opt/app1/locales");
103 ui_toolbar_add_default("button"); 103 ui_toolbar_add_default("button");
104 104
105 printf("create window\n"); 105 printf("create window\n");
106 UiObject *window = ui_window("Mod0", NULL); 106 UiObject *window = ui_window("Mod0", NULL);
107 107
108 ui_layout_fill(window, FALSE); 108 tabview = ui_tabview(window);
109
110 ui_tab(window, "1");
109 ui_grid(window); 111 ui_grid(window);
110 ui_button(window, "Test1________________", action_button, NULL); 112 ui_button(window, "Test1________________", action_button, NULL);
111 ui_button(window, "Test2", action_button, NULL); 113 ui_button(window, "Test2", action_button, NULL);
112 ui_newline(window); 114 ui_newline(window);
113 ui_button(window, "Test1", action_button, NULL); 115 ui_button(window, "Test1", action_button, NULL);
114 ui_button(window, "Test2", action_button, NULL); 116 ui_button(window, "Test2", action_button, NULL);
115 ui_end(window); 117 ui_end(window);
118 ui_end(window);
119
120 ui_tab(window, "2");
121 ui_textarea_nv(window, "text");
122 ui_button(window, "Zurück", action_test, NULL);
123
124 ui_end(window);
116 125
117 ui_show(window); 126 ui_show(window);
118 ui_main(); 127 ui_main();
119 128
120 return (EXIT_SUCCESS); 129 return (EXIT_SUCCESS);

mercurial