53 case 1: return p->mail; |
53 case 1: return p->mail; |
54 } |
54 } |
55 return NULL; |
55 return NULL; |
56 } |
56 } |
57 |
57 |
|
58 UiString name; |
|
59 UiString mail; |
|
60 |
|
61 UIWIDGET tabview = NULL; |
|
62 |
58 void action_activate(UiEvent *event, void *data) { |
63 void action_activate(UiEvent *event, void *data) { |
59 UiListSelection *selection = event->eventdata; |
64 UiListSelection *selection = event->eventdata; |
60 printf("activate: %d\n", event->intval); |
65 printf("activate: %d\n", event->intval); |
61 } |
66 } |
62 |
67 |
70 } |
75 } |
71 |
76 |
72 void action_button(UiEvent *event, void *data) { |
77 void action_button(UiEvent *event, void *data) { |
73 printf("button: %d\n", event->intval); |
78 printf("button: %d\n", event->intval); |
74 char *s = ui_gettext(event->obj, "text"); |
79 char *s = ui_gettext(event->obj, "text"); |
75 printf("{%s}\n", s); |
80 printf("{%s}\n", s); |
|
81 printf("name: {%s}\n", ui_getval(name)); |
|
82 printf("mail: {%s}\n", ui_getval(mail)); |
|
83 ui_select_tab(tabview, 0); |
|
84 } |
|
85 |
|
86 void action_test(UiEvent *event, void *data) { |
|
87 ui_select_tab(tabview, 1); |
76 } |
88 } |
77 |
89 |
78 int main(int argc, char** argv) { |
90 int main(int argc, char** argv) { |
79 ui_init("app1", argc, argv); |
91 ui_init("app1", argc, argv); |
80 ui_locales_dir("/opt/app1/locales"); |
92 ui_locales_dir("/opt/app1/locales"); |
132 ui_table(window, list, model); |
144 ui_table(window, list, model); |
133 */ |
145 */ |
134 ui_layout_fill(window, FALSE); |
146 ui_layout_fill(window, FALSE); |
135 ui_grid(window); |
147 ui_grid(window); |
136 ui_label(window, "Name"); |
148 ui_label(window, "Name"); |
137 ui_textfield(window, NULL); |
149 ui_textfield(window, &name); |
138 ui_newline(window); |
150 ui_newline(window); |
139 ui_label(window, "Email"); |
151 ui_label(window, "Email"); |
140 ui_textfield(window, NULL); |
152 ui_textfield(window, &mail); |
141 ui_newline(window); |
153 ui_newline(window); |
142 ui_end(window); |
154 ui_end(window); |
143 |
155 |
|
156 tabview = ui_tabview(window); |
|
157 |
|
158 ui_tab(window, "Editor"); |
144 ui_textarea_nv(window, "text"); |
159 ui_textarea_nv(window, "text"); |
145 ui_button(window, "Submit", NULL, NULL); |
160 ui_button(window, "Submit", action_test, NULL); |
146 //ui_end(window); |
161 ui_end(window); |
|
162 |
|
163 ui_tab(window, "Button"); |
|
164 ui_button(window, "TestButton", NULL, NULL); |
|
165 ui_end(window); |
|
166 |
|
167 ui_end(window); |
|
168 ui_button(window, "End", NULL, NULL); |
147 /* |
169 /* |
148 UiTabbedPane *view = ui_tabbed_document_view(window); |
170 UiTabbedPane *view = ui_tabbed_document_view(window); |
149 |
171 |
150 UiObject *tab1 = ui_document_tab(view); |
172 UiObject *tab1 = ui_document_tab(view); |
151 Document *doc1 = ui_document_new(1024); |
173 Document *doc1 = ui_document_new(1024); |