ui/gtk/container.c

changeset 987
77c5e7cadf96
parent 941
e7459e9fbed2
equal deleted inserted replaced
986:6f7600c2b9e1 987:77c5e7cadf96
110 uic_object_push_container(obj, container); 110 uic_object_push_container(obj, container);
111 } 111 }
112 return add; 112 return add;
113 } 113 }
114 114
115 /* -------------------- Custom Container -------------------- */
116
117 void ui_custom_container_add(UiContainerPrivate *ct, GtkWidget *widget, UiLayout *layout) {
118 UiCustomContainer *custom = (UiCustomContainer*)ct;
119 custom->add(custom->obj, ct->widget, widget, custom->userdata);
120 }
121
122 void ui_custom_container_create(UiObject *obj, UIWIDGET widget, ui_addwidget_func add_child, void *userdata) {
123 UiCustomContainer *container = cxZalloc(obj->ctx->allocator, sizeof(UiCustomContainer));
124 container->container.add = ui_custom_container_add;
125 container->container.widget = widget;
126 container->add = add_child;
127 container->userdata = userdata;
128 uic_object_push_container(obj, (UiContainerX*)container);
129 }
115 130
116 /* -------------------- Box Container -------------------- */ 131 /* -------------------- Box Container -------------------- */
117 UiContainerX* ui_box_container(UiObject *obj, GtkWidget *box, UiSubContainerType type) { 132 UiContainerX* ui_box_container(UiObject *obj, GtkWidget *box, UiSubContainerType type) {
118 UiBoxContainer *ct = cxCalloc( 133 UiBoxContainer *ct = cxCalloc(
119 obj->ctx->allocator, 134 obj->ctx->allocator,
983 } else if(hb->part == 2) { 998 } else if(hb->part == 2) {
984 if(!hb->centerbox) { 999 if(!hb->centerbox) {
985 GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); 1000 GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
986 hb->centerbox = box; 1001 hb->centerbox = box;
987 UI_HEADERBAR_SET_TITLE_WIDGET(ct->widget, box); 1002 UI_HEADERBAR_SET_TITLE_WIDGET(ct->widget, box);
1003 UI_HEADERBAR_SHOW_TITLE_WIDGET(ct->widget, TRUE);
1004 UI_HEADERBAR_SETTINGS(ct->widget);
988 } 1005 }
989 BOX_ADD(hb->centerbox, widget); 1006 BOX_ADD(hb->centerbox, widget);
990 } 1007 }
991 } 1008 }
992 1009

mercurial