fix hbox (GTK) newapi

Sun, 31 Mar 2024 09:50:49 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 31 Mar 2024 09:50:49 +0200
branch
newapi
changeset 273
1dd2456c51d3
parent 272
1a30bf64cb22
child 274
9e2aee097b69

fix hbox (GTK)

ui/gtk/container.c file | annotate | diff | comparison | revisions
--- a/ui/gtk/container.c	Mon Feb 26 21:37:56 2024 +0100
+++ b/ui/gtk/container.c	Sun Mar 31 09:50:49 2024 +0200
@@ -259,12 +259,12 @@
     UiContainer *ct = current->container;
     UI_APPLY_LAYOUT1(current, args);
     
-    GtkWidget *vbox = ui_gtk_vbox_new(args.spacing);   
-    GtkWidget *widget = args.margin > 0 ? box_set_margin(vbox, args.margin) : vbox;
+    GtkWidget *box = type == UI_CONTAINER_VBOX ? ui_gtk_vbox_new(args.spacing) : ui_gtk_hbox_new(args.spacing);
+    GtkWidget *widget = args.margin > 0 ? box_set_margin(box, args.margin) : box;
     ct->add(ct, widget, TRUE);
     
-    UiObject *newobj = uic_object_new(obj, vbox);
-    newobj->container = ui_box_container(obj, vbox);
+    UiObject *newobj = uic_object_new(obj, box);
+    newobj->container = ui_box_container(obj, box);
     uic_obj_add(obj, newobj);
     
     return widget;

mercurial