ui/gtk/widget.c

changeset 115
e57ca2747782
parent 112
c3f2f16fa4b8
--- a/ui/gtk/widget.c	Sun Dec 07 20:00:33 2025 +0100
+++ b/ui/gtk/widget.c	Sat Dec 13 15:58:58 2025 +0100
@@ -31,7 +31,20 @@
 
 #include "../common/object.h"
 
-UIEXPORT UIWIDGET ui_customwidget_create(UiObject *obj, ui_createwidget_func create_widget, void *userdata, UiWidgetArgs *args) {
+void ui_widget_size_request(UIWIDGET w, int width, int height) {
+    if(width > 0 || height > 0) {
+        if(width == 0) {
+            width = -1;
+        }
+        if(height == 0) {
+            height = -1;
+        }
+        gtk_widget_set_size_request(w, width, height);
+    }
+}
+
+
+UIWIDGET ui_customwidget_create(UiObject *obj, ui_createwidget_func create_widget, void *userdata, UiWidgetArgs *args) {
     UIWIDGET widget = create_widget(obj, args, userdata);
     
     UiContainerPrivate *ct = (UiContainerPrivate*)obj->container_end;

mercurial