90 printf("redo\n"); |
94 printf("redo\n"); |
91 TestWindowData *wd = event->window; |
95 TestWindowData *wd = event->window; |
92 ui_text_redo(&wd->text); |
96 ui_text_redo(&wd->text); |
93 } |
97 } |
94 |
98 |
|
99 void action_document(UiEvent *event, void *data) { |
|
100 UiList *documents = data; |
|
101 } |
|
102 |
95 |
103 |
96 int main(int argc, char** argv) { |
104 int main(int argc, char** argv) { |
97 ui_init("app1", argc, argv); |
105 ui_init("app1", argc, argv); |
98 |
106 |
|
107 list = ui_list_new(); |
|
108 ui_list_append(list, "file1.txt"); |
|
109 ui_list_append(list, "hello.txt"); |
|
110 ui_list_append(list, "main.c"); |
99 |
111 |
100 ui_menu("File"); |
112 ui_menu("File"); |
101 ui_menuitem("New", action_new, NULL); |
113 ui_menuitem("New", action_new, NULL); |
102 ui_menuitem("Open", action_open, NULL); |
114 ui_menuitem("Open", action_open, NULL); |
103 ui_menuseparator(); |
115 ui_menuseparator(); |
104 ui_menuitem("Dokument 1", action_doc1, NULL); |
116 ui_menuitem("Dokument 1", action_doc1, NULL); |
105 ui_menuitem("Dokument 2", action_doc2, NULL); |
117 ui_menuitem("Dokument 2", action_doc2, NULL); |
|
118 void ui_menuseparator(); |
106 ui_menuseparator(); |
119 ui_menuseparator(); |
107 ui_checkitem_nv("Check", "check1"); |
120 ui_checkitem_nv("Check", "check1"); |
108 //ui_checkitem("Check", action_open, NULL); |
121 //ui_checkitem("Check", action_open, NULL); |
109 ui_menuitem("Close", action_close, NULL); |
122 ui_menuitem("Close", action_close, NULL); |
|
123 void ui_menuseparator(); |
|
124 ui_menuitem_list(list, action_document, list); |
110 |
125 |
111 |
126 |
112 |
127 |
113 ui_toolitem_st("new", UI_STOCK_NEW, action_new, NULL); |
128 ui_toolitem_st("new", UI_STOCK_NEW, action_new, NULL); |
114 ui_toolitem_st("open", UI_STOCK_OPEN, action_open, NULL); |
129 ui_toolitem_st("open", UI_STOCK_GO_BACK, action_open, NULL); |
115 ui_toolitem_st("save", UI_STOCK_SAVE, action_save, NULL); |
130 ui_toolitem_st("save", UI_STOCK_GO_FORWARD, action_save, NULL); |
116 ui_toolitem_st("close", UI_STOCK_CLOSE, action_close, NULL); |
131 ui_toolitem_st("close", UI_STOCK_CLOSE, action_close, NULL); |
117 ui_toolitem_st("undo", UI_STOCK_UNDO, action_undo, NULL); |
132 ui_toolitem_st("undo", UI_STOCK_UNDO, action_undo, NULL); |
118 ui_toolitem_st("redo", UI_STOCK_REDO, action_redo, NULL); |
133 ui_toolitem_st("redo", UI_STOCK_REDO, action_redo, NULL); |
119 |
134 |
120 ui_toolbar_add_default("new"); |
135 ui_toolbar_add_default("new"); |