application/main.c

changeset 155
b907d8059290
parent 154
8a4451fcb736
child 158
4bde241c49b1
equal deleted inserted replaced
154:8a4451fcb736 155:b907d8059290
95 95
96 Document* create_doc(char *str) { 96 Document* create_doc(char *str) {
97 Document *doc = ui_document_new(sizeof(Document)); 97 Document *doc = ui_document_new(sizeof(Document));
98 UiContext *ctx = ui_document_context(doc); 98 UiContext *ctx = ui_document_context(doc);
99 99
100 //doc->text = ui_text_new(ctx, "text"); 100 doc->text = ui_text_new(ctx, "text");
101 doc->t1 = ui_string_new(ctx, "t1"); 101 doc->t1 = ui_string_new(ctx, "t1");
102 //doc->t2 = ui_string_new(ctx, "t2"); 102 doc->t2 = ui_string_new(ctx, "t2");
103 //doc->t3 = ui_string_new(ctx, "t3"); 103 doc->t3 = ui_string_new(ctx, "t3");
104 104
105 //doc->i = ui_int_new(ctx, "int"); 105 doc->i = ui_int_new(ctx, "int");
106 //doc->d = ui_double_new(ctx, "d"); 106 doc->d = ui_double_new(ctx, "d");
107 //->r = ui_range_new(ctx, "r"); 107 doc->r = ui_range_new(ctx, "r");
108 108
109 //doc->progress = ui_double_new(ctx, "progress"); 109 doc->progress = ui_double_new(ctx, "progress");
110 110
111 //doc->list = ui_list_new(ctx, "list"); 111 doc->list = ui_list_new(ctx, "list");
112 Entry *e1 = calloc(1, sizeof(Entry)); 112 Entry *e1 = calloc(1, sizeof(Entry));
113 e1->name = "test"; 113 e1->name = "test";
114 e1->desc = "test file"; 114 e1->desc = "test file";
115 Entry *e2 = calloc(1, sizeof(Entry)); 115 Entry *e2 = calloc(1, sizeof(Entry));
116 e2->name = str; 116 e2->name = str;
117 e2->desc = "important document"; 117 e2->desc = "important document";
118 //ui_list_append(doc->list, e1); 118 ui_list_append(doc->list, e1);
119 //ui_list_append(doc->list, e2); 119 ui_list_append(doc->list, e2);
120 120
121 return doc; 121 return doc;
122 } 122 }
123 123
124 void* model_get(Entry *e, int col) { 124 void* model_get(Entry *e, int col) {
160 d2 = create_doc("doc2"); 160 d2 = create_doc("doc2");
161 161
162 UiObject *obj = ui_window("Test", NULL); 162 UiObject *obj = ui_window("Test", NULL);
163 ui_set_document(obj, d1); 163 ui_set_document(obj, d1);
164 164
165 //ui_textarea_nv(obj, "text"); 165 ui_textarea_nv(obj, "text");
166 //ui_radiobutton_nv(obj, "1", "int"); 166 //ui_radiobutton_nv(obj, "1", "int");
167 //ui_radiobutton_nv(obj, "2", "int"); 167 //ui_radiobutton_nv(obj, "2", "int");
168 //ui_radiobutton_nv(obj, "3", "int"); 168 //ui_radiobutton_nv(obj, "3", "int");
169 169
170 ui_textfield_nv(obj, "t1"); 170 ui_textfield_nv(obj, "t1");

mercurial