ui/gtk/text.c

changeset 110
c00e968d018b
parent 109
c3dfcb8f0be7
child 112
c3f2f16fa4b8
--- a/ui/gtk/text.c	Sun Aug 24 15:24:16 2025 +0200
+++ b/ui/gtk/text.c	Sat Oct 04 14:52:59 2025 +0200
@@ -616,10 +616,11 @@
                 uitext);
     
     if(args->width > 0) {
-        // TODO: gtk4
-#if GTK_MAJOR_VERSION <= 3
-        gtk_entry_set_width_chars(GTK_ENTRY(textfield), args->width);
-#endif
+        // An early implementation used gtk_entry_set_width_chars,
+        // but that is not available on gtk4 and other toolkits
+        // also don't have this. Setting the width in pixels can
+        // be implemented on all platforms
+        gtk_widget_set_size_request(textfield, args->width, -1);
     }
     if(frameless) {
         // TODO: gtk2legacy workaroud

mercurial