application/main.c

changeset 64
6ef2c7f73a30
parent 63
46a42f0c4f93
child 66
8d490d97aab8
--- a/application/main.c	Mon Jan 05 11:49:46 2015 +0100
+++ b/application/main.c	Mon Jan 05 14:47:19 2015 +0100
@@ -55,6 +55,11 @@
     return NULL;
 }
 
+UiString name;
+UiString mail;
+
+UIWIDGET tabview = NULL;
+
 void action_activate(UiEvent *event, void *data) {
     UiListSelection *selection = event->eventdata;
     printf("activate: %d\n", event->intval);
@@ -72,7 +77,14 @@
 void action_button(UiEvent *event, void *data) {
     printf("button: %d\n", event->intval);
     char *s = ui_gettext(event->obj, "text");
-    printf("{%s}\n", s);    
+    printf("{%s}\n", s);
+    printf("name: {%s}\n", ui_getval(name));
+    printf("mail: {%s}\n", ui_getval(mail));
+    ui_select_tab(tabview, 0);
+}
+
+void action_test(UiEvent *event, void *data) {
+    ui_select_tab(tabview, 1);
 }
 
 int main(int argc, char** argv) { 
@@ -134,16 +146,26 @@
     ui_layout_fill(window, FALSE);
     ui_grid(window);
     ui_label(window, "Name");
-    ui_textfield(window, NULL);
+    ui_textfield(window, &name);
     ui_newline(window);
     ui_label(window, "Email");
-    ui_textfield(window, NULL);
+    ui_textfield(window, &mail);
     ui_newline(window);
     ui_end(window);
     
+    tabview = ui_tabview(window);
+    
+    ui_tab(window, "Editor");
     ui_textarea_nv(window, "text");
-    ui_button(window, "Submit", NULL, NULL);
-    //ui_end(window);
+    ui_button(window, "Submit", action_test, NULL);
+    ui_end(window);
+    
+    ui_tab(window, "Button");
+    ui_button(window, "TestButton", NULL, NULL);
+    ui_end(window);
+    
+    ui_end(window);
+    ui_button(window, "End", NULL, NULL);
     /*
     UiTabbedPane *view = ui_tabbed_document_view(window);
     

mercurial