application/main.c

changeset 14
e2fd132ab781
parent 12
fe94e0fb9ef3
child 15
7a36f91c22f7
--- a/application/main.c	Sat Mar 29 19:12:07 2014 +0100
+++ b/application/main.c	Mon Mar 31 20:22:16 2014 +0200
@@ -43,6 +43,8 @@
 
 UiInteger check1;
 
+UiList *list;
+
 void action_new(UiEvent *event, void *data) {
     UiObject *window = ui_window("Mod1", NULL);
     //ui_window_addint(window, "check1");
@@ -60,6 +62,8 @@
     TestWindowData *wd = event->window;
     printf("Text: {%s}\n", ui_getval(wd->text));
     ui_setval(wd->text, "--------");
+    
+    ui_list_append(list, "abc");
 }
 
 void action_close(UiEvent *event, void *data) {
@@ -92,10 +96,18 @@
     ui_text_redo(&wd->text);
 }
 
+void action_document(UiEvent *event, void *data) {
+    UiList *documents = data;
+}
+
 
 int main(int argc, char** argv) {
     ui_init("app1", argc, argv);
     
+    list = ui_list_new();
+    ui_list_append(list, "file1.txt");
+    ui_list_append(list, "hello.txt");
+    ui_list_append(list, "main.c");
     
     ui_menu("File");
     ui_menuitem("New", action_new, NULL);
@@ -103,16 +115,19 @@
     ui_menuseparator();
     ui_menuitem("Dokument 1", action_doc1, NULL);
     ui_menuitem("Dokument 2", action_doc2, NULL);
+    void ui_menuseparator();
     ui_menuseparator();
     ui_checkitem_nv("Check", "check1");
     //ui_checkitem("Check", action_open, NULL);
     ui_menuitem("Close", action_close, NULL);
+    void ui_menuseparator();
+    ui_menuitem_list(list, action_document, list);
     
     
     
     ui_toolitem_st("new", UI_STOCK_NEW, action_new, NULL);
-    ui_toolitem_st("open", UI_STOCK_OPEN, action_open, NULL);
-    ui_toolitem_st("save", UI_STOCK_SAVE, action_save, NULL);
+    ui_toolitem_st("open", UI_STOCK_GO_BACK, action_open, NULL);
+    ui_toolitem_st("save", UI_STOCK_GO_FORWARD, action_save, NULL);
     ui_toolitem_st("close", UI_STOCK_CLOSE, action_close, NULL);
     ui_toolitem_st("undo", UI_STOCK_UNDO, action_undo, NULL);
     ui_toolitem_st("redo", UI_STOCK_REDO, action_redo, NULL);

mercurial