application/main.c

changeset 54
97bafeca1c7c
parent 53
62205699cd0e
child 55
9076eb40454d
equal deleted inserted replaced
53:62205699cd0e 54:97bafeca1c7c
42 typedef struct Document { 42 typedef struct Document {
43 UiText text; 43 UiText text;
44 } Document; 44 } Document;
45 45
46 void action_close(UiEvent *event, void *data) { 46 void action_close(UiEvent *event, void *data) {
47 ui_close(event->obj); 47 printf("action_close\n");
48 //ui_close(event->obj);
48 } 49 }
49 50
50 char* person_getvalue(Person *p, int column) { 51 char* person_getvalue(Person *p, int column) {
51 switch(column) { 52 switch(column) {
52 case 0: return p->name; 53 case 0: return p->name;
82 //ui_openfilefunc(action_new, NULL); 83 //ui_openfilefunc(action_new, NULL);
83 84
84 85
85 86
86 ui_menu("File"); 87 ui_menu("File");
88 //ui_menuitem("Close", action_close, NULL);
87 ui_menuitem_st(UI_STOCK_CLOSE, action_close, NULL); 89 ui_menuitem_st(UI_STOCK_CLOSE, action_close, NULL);
88 ui_checkitem("Check", action_button, NULL); 90 //ui_checkitem("Check", action_button, NULL);
89 91
90 ui_toolitem_st("button", UI_STOCK_GO_BACK, action_button, NULL); 92 //ui_toolitem_st("button", UI_STOCK_GO_BACK, action_button, NULL);
91 ui_toolbar_add_default("button"); 93 //ui_toolbar_add_default("button");
92 94
93 printf("create window\n"); 95 printf("create window\n");
94 UiObject *window = ui_window("Mod0", NULL); 96 UiObject *window = ui_window("Mod0", NULL);
95 97
98 /*
96 UiModelInfo *model = ui_model_info(window->ctx, UI_STRING, "Name", UI_STRING, "Email", -1); 99 UiModelInfo *model = ui_model_info(window->ctx, UI_STRING, "Name", UI_STRING, "Email", -1);
97 model->getvalue = (ui_model_getvalue_f)person_getvalue; 100 model->getvalue = (ui_model_getvalue_f)person_getvalue;
98 model->activate = action_activate; 101 model->activate = action_activate;
99 model->selection = action_select; 102 model->selection = action_select;
100 UiList *list = ui_list_new(); 103 UiList *list = ui_list_new();
140 Document *doc3 = ui_document_new(1024); 143 Document *doc3 = ui_document_new(1024);
141 UiContext *ctx3 = ui_document_context(doc3); 144 UiContext *ctx3 = ui_document_context(doc3);
142 ui_document_regtext(doc3, "text", &doc3->text); 145 ui_document_regtext(doc3, "text", &doc3->text);
143 ui_textarea_nv(tab3, "text"); 146 ui_textarea_nv(tab3, "text");
144 ui_set_document(tab3, doc3); 147 ui_set_document(tab3, doc3);
148 */
145 149
146 ui_show(window); 150 ui_show(window);
147 ui_main(); 151 ui_main();
148 152
149 return (EXIT_SUCCESS); 153 return (EXIT_SUCCESS);

mercurial