add frame container width/height args (Motif)

Fri, 21 Nov 2025 15:10:02 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 21 Nov 2025 15:10:02 +0100
changeset 922
20dff5f878e1
parent 921
c2b318b93062
child 923
b72d47697644

add frame container width/height args (Motif)

ui/motif/container.c file | annotate | diff | comparison | revisions
ui/ui/container.h file | annotate | diff | comparison | revisions
--- a/ui/motif/container.c	Thu Nov 20 20:09:00 2025 +0100
+++ b/ui/motif/container.c	Fri Nov 21 15:10:02 2025 +0100
@@ -249,6 +249,12 @@
     UiLayout layout = UI_ARGS2LAYOUT(args);
     
     Widget parent = ui_container_prepare(ctn, &layout, xargs, &n);
+    if(args->width > 0) {
+        XtSetArg(xargs[n], XmNwidth, args->width); n++;
+    }
+    if(args->height > 0) {
+        XtSetArg(xargs[n], XmNheight, args->height); n++;
+    }
     
     char *name = args->name ? (char*)args->name : "frame";
     Widget frame = XmCreateFrame(parent, name, xargs, n);
@@ -697,6 +703,12 @@
     int n = 0;
     
     XtSetArg(xargs[n], XmNscrollingPolicy, XmAUTOMATIC); n++;
+    if(args->width > 0) {
+        XtSetArg(xargs[n], XmNwidth, args->width); n++;
+    }
+    if(args->height > 0) {
+        XtSetArg(xargs[n], XmNheight, args->height); n++;
+    }
     
     Widget parent = ui_container_prepare(ctn, &layout, xargs, &n);
     Widget scrolledwindow = XmCreateScrolledWindow(parent, "scrolledwindow", xargs, n);
--- a/ui/ui/container.h	Thu Nov 20 20:09:00 2025 +0100
+++ b/ui/ui/container.h	Fri Nov 21 15:10:02 2025 +0100
@@ -98,6 +98,8 @@
     int margin_bottom;
     int colspan;
     int rowspan;
+    int width;
+    int height;
     const char *name;
     const char *style_class;
 

mercurial