ui/gtk/container.c

changeset 783
25b2da0aac15
parent 768
dc8e64b87e60
child 794
ebd7b3394501
equal deleted inserted replaced
782:a72d7509d292 783:25b2da0aac15
1050 uic_obj_add(obj, newobj); 1050 uic_obj_add(obj, newobj);
1051 1051
1052 return box; 1052 return box;
1053 } 1053 }
1054 #endif 1054 #endif
1055
1056 /* ------------------------ Split Window Panels ------------------------ */
1057
1058 static UIWIDGET splitwindow_panel(UiObject *obj, GtkWidget *pbox, UiSidebarArgs *args) {
1059 if(!pbox) {
1060 fprintf(stderr, "Error: window is not a splitview window\n");
1061 return NULL;
1062 }
1063
1064 GtkWidget *box = ui_gtk_vbox_new(args->spacing);
1065 ui_box_set_margin(box, args->margin);
1066 BOX_ADD_EXPAND(pbox, box);
1067
1068 UiObject *newobj = uic_object_new(obj, box);
1069 newobj->container = ui_box_container(obj, box, UI_CONTAINER_VBOX);
1070 uic_obj_add(obj, newobj);
1071
1072 return box;
1073 }
1074
1075 UIWIDGET ui_left_panel_create(UiObject *obj, UiSidebarArgs *args) {
1076 return splitwindow_panel(obj, g_object_get_data(G_OBJECT(obj->widget), "ui_left_panel"), args);
1077 }
1078
1079 UIWIDGET ui_right_panel_create(UiObject *obj, UiSidebarArgs *args) {
1080 return splitwindow_panel(obj, g_object_get_data(G_OBJECT(obj->widget), "ui_right_panel"), args);
1081 }
1082
1055 1083
1056 /* -------------------- Splitpane -------------------- */ 1084 /* -------------------- Splitpane -------------------- */
1057 1085
1058 static GtkWidget* create_paned(UiOrientation orientation) { 1086 static GtkWidget* create_paned(UiOrientation orientation) {
1059 #if GTK_MAJOR_VERSION >= 3 1087 #if GTK_MAJOR_VERSION >= 3

mercurial