application/main.c

changeset 149
479209198de3
parent 147
2e384acc89a6
child 150
5cee4cb5ad79
equal deleted inserted replaced
148:4e0b38bbd6c4 149:479209198de3
40 UiString *t3; 40 UiString *t3;
41 UiInteger *i; 41 UiInteger *i;
42 UiDouble *d; 42 UiDouble *d;
43 UiRange *r; 43 UiRange *r;
44 UiList *list; 44 UiList *list;
45 UiDouble *progress;
45 } Document; 46 } Document;
46 47
47 typedef struct Entry { 48 typedef struct Entry {
48 char *name; 49 char *name;
49 char *desc; 50 char *desc;
103 104
104 doc->i = ui_int_new(ctx, "int"); 105 doc->i = ui_int_new(ctx, "int");
105 doc->d = ui_double_new(ctx, "d"); 106 doc->d = ui_double_new(ctx, "d");
106 doc->r = ui_range_new(ctx, "r"); 107 doc->r = ui_range_new(ctx, "r");
107 108
109 doc->progress = ui_double_new(ctx, "progress");
110
108 doc->list = ui_list_new(ctx, "list"); 111 doc->list = ui_list_new(ctx, "list");
109 printf("doc list: %d\n", doc->list); 112 printf("doc list: %d\n", doc->list);
110 Entry *e1 = malloc(sizeof(Entry)); 113 Entry *e1 = malloc(sizeof(Entry));
111 e1->name = "test"; 114 e1->name = "test";
112 e1->desc = "test file"; 115 e1->desc = "test file";
166 ui_radiobutton_nv(obj, "2", "int"); 169 ui_radiobutton_nv(obj, "2", "int");
167 ui_radiobutton_nv(obj, "3", "int"); 170 ui_radiobutton_nv(obj, "3", "int");
168 171
169 ui_textfield_nv(obj, "t1"); 172 ui_textfield_nv(obj, "t1");
170 //ui_textarea_nv(obj, "text"); 173 //ui_textarea_nv(obj, "text");
171 d1->t1->observers = ui_add_observer(d1->t1->observers, observ, "t1"); 174 //d1->t1->observers = ui_add_observer(d1->t1->observers, observ, "t1");
172 //d1->text->observers = ui_add_observer(d1->text->observers, observ, "text"); 175 //d1->text->observers = ui_add_observer(d1->text->observers, observ, "text");
173 176
174 UiModel *model = ui_model(obj->ctx, UI_ICON_TEXT, "name", UI_STRING, "desc", -1); 177 UiModel *model = ui_model(obj->ctx, UI_ICON_TEXT, "name", UI_STRING, "desc", -1);
175 model->getvalue = (ui_getvaluefunc)model_get; 178 model->getvalue = (ui_getvaluefunc)model_get;
176 model->drop = list_drop; 179 model->drop = list_drop;
183 ui_spinnerr_nv(obj, "r"); 186 ui_spinnerr_nv(obj, "r");
184 d1->r->setrange(d1->r, 0, 10); 187 d1->r->setrange(d1->r, 0, 10);
185 d1->r->setextent(d1->r, 1); 188 d1->r->setextent(d1->r, 1);
186 d1->d->observers = ui_add_observer(d1->d->observers, doublechanged, NULL); 189 d1->d->observers = ui_add_observer(d1->d->observers, doublechanged, NULL);
187 190
191 ui_progressbar_nv(obj, "progress");
188 ui_button(obj, "Switch Document", action_newdoc, NULL); 192 ui_button(obj, "Switch Document", action_newdoc, NULL);
189 193
190 ui_show(obj); 194 ui_show(obj);
191 } 195 }
192 196

mercurial