application/main.c

changeset 150
5cee4cb5ad79
parent 149
479209198de3
child 151
11f3bb408051
equal deleted inserted replaced
149:479209198de3 150:5cee4cb5ad79
107 doc->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 printf("doc list: %d\n", doc->list); 112 Entry *e1 = calloc(1, sizeof(Entry));
113 Entry *e1 = malloc(sizeof(Entry));
114 e1->name = "test"; 113 e1->name = "test";
115 e1->desc = "test file"; 114 e1->desc = "test file";
116 Entry *e2 = malloc(sizeof(Entry)); 115 Entry *e2 = calloc(1, sizeof(Entry));
117 e2->name = str; 116 e2->name = str;
118 e2->desc = "important document"; 117 e2->desc = "important document";
119 ui_list_append(doc->list, e1); 118 ui_list_append(doc->list, e1);
120 ui_list_append(doc->list, e2); 119 ui_list_append(doc->list, e2);
121 120
132 } 131 }
133 return NULL; 132 return NULL;
134 } 133 }
135 134
136 void action_newdoc(UiEvent *event, void *data) { 135 void action_newdoc(UiEvent *event, void *data) {
137 printf("new doc\n"); 136 printf("new doc;\n ");
138 137
139 Document *newd = next_doc(); 138 Document *newd = next_doc();
140 printf("newd: %d\n", (int)(intptr_t)newd);
141 ui_set_document(event->obj, newd); 139 ui_set_document(event->obj, newd);
142 } 140 }
143 141
144 void observ(UiEvent *event, void *data) { 142 void observ(UiEvent *event, void *data) {
145 printf("observ: %s\n", (char*)data); 143 printf("observ: %s\n", (char*)data);

mercurial