ui/gtk/container.c

branch
newapi
changeset 273
1dd2456c51d3
parent 271
94d44bdcad3e
equal deleted inserted replaced
272:1a30bf64cb22 273:1dd2456c51d3
257 UIWIDGET ui_box_create(UiObject *obj, UiContainerArgs args, UiSubContainerType type) { 257 UIWIDGET ui_box_create(UiObject *obj, UiContainerArgs args, UiSubContainerType type) {
258 UiObject *current = uic_current_obj(obj); 258 UiObject *current = uic_current_obj(obj);
259 UiContainer *ct = current->container; 259 UiContainer *ct = current->container;
260 UI_APPLY_LAYOUT1(current, args); 260 UI_APPLY_LAYOUT1(current, args);
261 261
262 GtkWidget *vbox = ui_gtk_vbox_new(args.spacing); 262 GtkWidget *box = type == UI_CONTAINER_VBOX ? ui_gtk_vbox_new(args.spacing) : ui_gtk_hbox_new(args.spacing);
263 GtkWidget *widget = args.margin > 0 ? box_set_margin(vbox, args.margin) : vbox; 263 GtkWidget *widget = args.margin > 0 ? box_set_margin(box, args.margin) : box;
264 ct->add(ct, widget, TRUE); 264 ct->add(ct, widget, TRUE);
265 265
266 UiObject *newobj = uic_object_new(obj, vbox); 266 UiObject *newobj = uic_object_new(obj, box);
267 newobj->container = ui_box_container(obj, vbox); 267 newobj->container = ui_box_container(obj, box);
268 uic_obj_add(obj, newobj); 268 uic_obj_add(obj, newobj);
269 269
270 return widget; 270 return widget;
271 } 271 }
272 272

mercurial