application/main.c

changeset 848
5a4b72489111
parent 844
3106d9ca2f9c
child 849
63623ef950e5
equal deleted inserted replaced
847:50de0f36973f 848:5a4b72489111
582 static UiBool list_save(UiList *list, int row, int col, UiCellValue *value, void *userdata) { 582 static UiBool list_save(UiList *list, int row, int col, UiCellValue *value, void *userdata) {
583 printf("list new value at [%d, %d]: %s\n", row, col, value->string); 583 printf("list new value at [%d, %d]: %s\n", row, col, value->string);
584 return FALSE; 584 return FALSE;
585 } 585 }
586 586
587 static void draw(UiEvent *event, UiGraphics *g, void *userdata) {
588 ui_draw_line(g, 0, 0, g->width, g->height);
589 ui_draw_line(g, g->width, 0, 0, g->height);
590
591 ui_draw_rect(g, (g->width/2)-80, (g->height/2)-40, 160, 80, FALSE);
592 }
593
587 void application_startup(UiEvent *event, void *data) { 594 void application_startup(UiEvent *event, void *data) {
588 // global list 595 // global list
589 UiContext *global = ui_global_context(); 596 UiContext *global = ui_global_context();
590 menu_list = ui_list_new(global, "menulist"); 597 menu_list = ui_list_new(global, "menulist");
591 ui_list_append(menu_list, "menu list item 1"); 598 ui_list_append(menu_list, "menu list item 1");
786 ui_textfield(obj, .varname = "link_label", .colspan = 2); 793 ui_textfield(obj, .varname = "link_label", .colspan = 2);
787 ui_textfield(obj, .varname = "link_uri", .colspan = 2); 794 ui_textfield(obj, .varname = "link_uri", .colspan = 2);
788 ui_button(obj, .label = "Update Link", .onclick = action_change_link, .colspan = 2); 795 ui_button(obj, .label = "Update Link", .onclick = action_change_link, .colspan = 2);
789 } 796 }
790 } 797 }
798 }
799 ui_tab(obj, "Tab 12") {
800 ui_drawingarea(obj, .fill = TRUE, .draw = draw);
791 } 801 }
792 } 802 }
793 803
794 /* 804 /*
795 805

mercurial