application/main.c

changeset 124
80609f9675f1
parent 122
e82b01d17a78
child 125
3335268a8073
equal deleted inserted replaced
123:55adc92e7c09 124:80609f9675f1
95 95
96 //ui_text_free(text); 96 //ui_text_free(text);
97 //*/ 97 //*/
98 } 98 }
99 99
100 void* model_getval(void *obj, int col) {
101 if(col == 0) {
102 return "folder";
103 } else if(col == 2) {
104 return "test@localhost";
105 }
106 return obj;
107 }
108
100 UIMENU ctxmenu; 109 UIMENU ctxmenu;
101 void click(UiEvent *event, void *data) { 110 void click(UiEvent *event, void *data) {
102 UiMouseEvent *me = event->eventdata; 111 UiMouseEvent *me = event->eventdata;
103 printf("click[%d](%d,%d)\n", me->type, me->x, me->y); 112 printf("click[%d](%d,%d)\n", me->type, me->x, me->y);
104 113
139 148
140 UiObject *obj = ui_window("Test", NULL); 149 UiObject *obj = ui_window("Test", NULL);
141 ui_context_closefunc(obj->ctx, window_close, NULL); 150 ui_context_closefunc(obj->ctx, window_close, NULL);
142 151
143 ///* 152 ///*
144 ui_vbox_sp(obj, 8, 4); 153 UiModelInfo *modeldesc = ui_model_info(obj->ctx, UI_ICON_TEXT, "Name", UI_STRING, "Mail", -1);
145 154 modeldesc->getvalue = model_getval;
146 ui_textfield(obj, NULL); 155 ui_table(obj, list, modeldesc);
147 ui_passwordfield(obj, NULL);
148 ui_frameless_textfield(obj, NULL);
149
150 ui_layout_fill(obj, FALSE);
151 ui_hbox_sp(obj, 0, 10);
152 ui_textfield_w(obj, 5, NULL);
153 ui_textfield_w(obj, 10, NULL);
154 ui_textfield(obj, NULL);
155 ui_end(obj);
156
157 ui_textarea(obj, NULL);
158
159 ui_end(obj);
160 //*/ 156 //*/
161 157
162 ui_show(obj); 158 ui_show(obj);
163 ui_main(); 159 ui_main();
164 160

mercurial