application/main.c

changeset 1256
da0899b1699d
parent 1251
a1623c48c998
equal deleted inserted replaced
1255:4681df3739f7 1256:da0899b1699d
757 static void content_toggled(UiEvent *event, void *userdata) { 757 static void content_toggled(UiEvent *event, void *userdata) {
758 int i = ui_var_get_int(event->obj->ctx, "ctntoggle"); 758 int i = ui_var_get_int(event->obj->ctx, "ctntoggle");
759 printf("content toggled: %d : %d\n", i, event->intval); 759 printf("content toggled: %d : %d\n", i, event->intval);
760 } 760 }
761 761
762 static void sourcelist_contextmenu_popup(UiEvent *event, void *userdata) {
763 printf("contextmenu popup at item: %d\n", event->intval);
764 }
765
762 void application_startup(UiEvent *event, void *data) { 766 void application_startup(UiEvent *event, void *data) {
763 // test window destruction 767 // test window destruction
764 UiObject *testobj = ui_window("testwindow"); 768 UiObject *testobj = ui_window("testwindow");
765 ui_object_unref(testobj); 769 ui_object_unref(testobj);
766 770
983 } 987 }
984 ui_tab(obj, "Tab 13") { 988 ui_tab(obj, "Tab 13") {
985 //UiModel *model = ui_model(obj->ctx, UI_STRING, "test", -1); 989 //UiModel *model = ui_model(obj->ctx, UI_STRING, "test", -1);
986 //ui_treeview(obj, .fill = TRUE, .model = model, .show_header = TRUE, .getvalue = tree_getvalue, .getdepth = tree_getdepth, .varname = "tree"); 990 //ui_treeview(obj, .fill = TRUE, .model = model, .show_header = TRUE, .getvalue = tree_getvalue, .getdepth = tree_getdepth, .varname = "tree");
987 991
988 ui_sourcelist2(obj, .fill = TRUE, .getvalue = sourcelist2_getvalue, .varname = "tree", .onactivate = sourcelist2_activate); 992 ui_sourcelist2(obj, .fill = TRUE, .getvalue = sourcelist2_getvalue, .varname = "tree", .onactivate = sourcelist2_activate, .contextmenu = sourcelist_menu, .oncontextmenupopup = sourcelist_contextmenu_popup);
989 } 993 }
990 } 994 }
991 995
992 /* 996 /*
993 997

mercurial