fix gtk3 build

Fri, 17 Oct 2025 16:02:26 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 17 Oct 2025 16:02:26 +0200
changeset 854
9291921f21c5
parent 853
380ec881faa2
child 855
37f8a9fa8251

fix gtk3 build

ui/gtk/graphics.c file | annotate | diff | comparison | revisions
--- a/ui/gtk/graphics.c	Fri Oct 17 15:44:30 2025 +0200
+++ b/ui/gtk/graphics.c	Fri Oct 17 16:02:26 2025 +0200
@@ -77,8 +77,14 @@
     GtkWidget *widget = gtk_drawing_area_new();
     ui_set_name_and_style(widget, args->name, args->style_class);
     
+#if GTK_CHECK_VERSION(4, 0, 0)
     gtk_drawing_area_set_content_width(GTK_DRAWING_AREA(widget), args->width > 0 ? args->width : 100);
     gtk_drawing_area_set_content_height(GTK_DRAWING_AREA(widget), args->height > 0 ? args->height : 100);
+#else
+    int w = args->width > 0 ? args->width : 100;
+    int h = args->height > 0 ? args->height : 100;
+    gtk_widget_set_size_request(widget, w, h);
+#endif
     
     UiContainerPrivate *ct = (UiContainerPrivate*)obj->container_end;
     UiLayout layout = UI_ARGS2LAYOUT(args);

mercurial