application/main.c

changeset 10
6f263196f916
parent 8
84a541c6e093
child 12
fe94e0fb9ef3
equal deleted inserted replaced
8:84a541c6e093 10:6f263196f916
48 //ui_window_addint(window, "check1"); 48 //ui_window_addint(window, "check1");
49 ui_show(window); 49 ui_show(window);
50 } 50 }
51 51
52 void action_open(UiEvent *event, void *data) { 52 void action_open(UiEvent *event, void *data) {
53 //printf("check1: %s\n", event->intval ? "true" : "false");
53 //printf("check1: %s\n", ui_getint(event->obj, "check1") ? "true" : "false"); 54 //printf("check1: %s\n", ui_getint(event->obj, "check1") ? "true" : "false");
54 TestDocument *doc = event->document; 55 TestDocument *doc = event->document;
55 printf("check1: %s\n", ui_getval(doc->check1) ? "true" : "false"); 56 printf("check1: %s\n", ui_getval(doc->check1) ? "true" : "false");
56 } 57 }
57 58
80 } 81 }
81 82
82 void action_undo(UiEvent *event, void *data) { 83 void action_undo(UiEvent *event, void *data) {
83 printf("undo\n"); 84 printf("undo\n");
84 TestWindowData *wd = event->window; 85 TestWindowData *wd = event->window;
85 ui_text_undo(&wd->text); 86 //ui_text_undo(&wd->text);
86 } 87 }
87 88
88 void action_redo(UiEvent *event, void *data) { 89 void action_redo(UiEvent *event, void *data) {
89 printf("redo\n"); 90 printf("redo\n");
90 TestWindowData *wd = event->window; 91 TestWindowData *wd = event->window;
91 ui_text_redo(&wd->text); 92 //ui_text_redo(&wd->text);
92 } 93 }
93 94
94 95
95 int main(int argc, char** argv) { 96 int main(int argc, char** argv) {
96 ui_init("app1", argc, argv); 97 ui_init("app1", argc, argv);
102 ui_menuseparator(); 103 ui_menuseparator();
103 ui_menuitem("Dokument 1", action_doc1, NULL); 104 ui_menuitem("Dokument 1", action_doc1, NULL);
104 ui_menuitem("Dokument 2", action_doc2, NULL); 105 ui_menuitem("Dokument 2", action_doc2, NULL);
105 ui_menuseparator(); 106 ui_menuseparator();
106 ui_checkitem_nv("Check", "check1"); 107 ui_checkitem_nv("Check", "check1");
108 //ui_checkitem("Check", action_open, NULL);
107 ui_menuitem("Close", action_close, NULL); 109 ui_menuitem("Close", action_close, NULL);
108 110
109 111
110 112
111 ui_toolitem_st("new", UI_STOCK_NEW, action_new, NULL); 113 ui_toolitem_st("new", UI_STOCK_NEW, action_new, NULL);

mercurial