150 doc->progress = ui_double_new(docctx, "progress"); |
151 doc->progress = ui_double_new(docctx, "progress"); |
151 doc->list = ui_list_new(docctx, "list"); |
152 doc->list = ui_list_new(docctx, "list"); |
152 ui_list_append(doc->list, "test1"); |
153 ui_list_append(doc->list, "test1"); |
153 ui_list_append(doc->list, "test2"); |
154 ui_list_append(doc->list, "test2"); |
154 ui_list_append(doc->list, "test3"); |
155 ui_list_append(doc->list, "test3"); |
|
156 doc->list2 = ui_list_new(docctx, "list2"); |
|
157 ui_list_append(doc->list2, "test1"); |
|
158 ui_list_append(doc->list2, "test2"); |
|
159 ui_list_append(doc->list2, "test3"); |
155 doc->radio = ui_int_new(docctx, "radio"); |
160 doc->radio = ui_int_new(docctx, "radio"); |
156 doc->tabview = ui_int_new(docctx, "tabview"); |
161 doc->tabview = ui_int_new(docctx, "tabview"); |
157 doc->image = ui_generic_new(docctx, "image"); |
162 doc->image = ui_generic_new(docctx, "image"); |
158 //doc->text = ui_text_new(docctx, "text"); |
163 //doc->text = ui_text_new(docctx, "text"); |
159 return doc; |
164 return doc; |
238 } |
243 } |
239 ui_show(obj); |
244 ui_show(obj); |
240 } |
245 } |
241 |
246 |
242 UiMenuBuilder *menubuilder; |
247 UiMenuBuilder *menubuilder; |
|
248 |
|
249 void* table_getvalue(void *row, int col) { |
|
250 return row; |
|
251 } |
243 |
252 |
244 void application_startup(UiEvent *event, void *data) { |
253 void application_startup(UiEvent *event, void *data) { |
245 // global list |
254 // global list |
246 UiContext *global = ui_global_context(); |
255 UiContext *global = ui_global_context(); |
247 menu_list = ui_list_new(global, "menulist"); |
256 menu_list = ui_list_new(global, "menulist"); |
301 ui_hbox0(obj) { |
310 ui_hbox0(obj) { |
302 ui_radiobutton(obj, .label = "Radio 1", .varname = "radio"); |
311 ui_radiobutton(obj, .label = "Radio 1", .varname = "radio"); |
303 ui_radiobutton(obj, .label = "Radio 2", .varname = "radio"); |
312 ui_radiobutton(obj, .label = "Radio 2", .varname = "radio"); |
304 ui_radiobutton(obj, .label = "Radio 3", .varname = "radio"); |
313 ui_radiobutton(obj, .label = "Radio 3", .varname = "radio"); |
305 } |
314 } |
|
315 ui_newline(obj); |
|
316 |
|
317 UiModel *model = ui_model(obj->ctx, UI_STRING, "col1", -1); |
|
318 model->getvalue = table_getvalue; |
|
319 ui_table(obj, .model = model, .list = doc->list2, .colspan = 2, .hexpand = TRUE, .contextmenu = menubuilder); |
306 } |
320 } |
307 } |
321 } |
308 ui_tab(obj, "Tab 2") { |
322 ui_tab(obj, "Tab 2") { |
309 ui_button(obj, .label = "Button 1 Start Thread", .onclick=action_start_thread); |
323 ui_button(obj, .label = "Button 1 Start Thread", .onclick=action_start_thread); |
310 ui_button(obj, .label = "Button 2 Notify Thread", .onclick=action_notify_thread); |
324 ui_button(obj, .label = "Button 2 Notify Thread", .onclick=action_notify_thread); |