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 doc->r = ui_range_new(ctx, "r"); |
107 //->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) { |