ui/motif/Grid.c

branch
newapi
changeset 429
0921f8a5d535
parent 426
3eb26df703bf
child 433
605bb5dc34f1
--- a/ui/motif/Grid.c	Sat Jan 04 15:16:51 2025 +0100
+++ b/ui/motif/Grid.c	Sat Jan 04 16:22:14 2025 +0100
@@ -409,6 +409,12 @@
         for(int i=0;i<w->composite.num_children;i++) {
             Widget child = w->composite.children[i];
             GridConstraintRec *constraints = child->core.constraints;
+            if(constraints->grid.pref_width == 0) {
+                constraints->grid.pref_width = child->core.width;
+            }
+            if(constraints->grid.pref_height == 0) {
+                constraints->grid.pref_height = child->core.height;
+            }
             
             if(constraints->grid.colspan > span_max || constraints->grid.rowspan > span_max) {
                 continue;
@@ -618,7 +624,9 @@
             }
         }
         
-        XtConfigureWidget(child, x, y, width, height, child->core.border_width);
+        if(width > 0 && height > 0) {
+            XtConfigureWidget(child, x, y, width, height, child->core.border_width);
+        }
         //printf("child %d %d - %d %d\n", (int)child->core.x, (int)child->core.y, (int)child->core.width, (int)child->core.height);
     }
     

mercurial