chiark / gitweb /
GTK 3 port: change API functions for widget sizing.
authorSimon Tatham <anakin@pobox.com>
Sat, 3 Oct 2015 11:28:24 +0000 (12:28 +0100)
committerSimon Tatham <anakin@pobox.com>
Sat, 3 Oct 2015 15:07:20 +0000 (16:07 +0100)
set_usize is deprecated, and get_preferred_size is the GTK 3 thing we
should use in place of size_request.

gtk.c

diff --git a/gtk.c b/gtk.c
index a4db53e20755dc297b4766619d6ef0c391e4900f..6e1ef531ae6b5dabc24b63065965c6cc374aab72 100644 (file)
--- a/gtk.c
+++ b/gtk.c
@@ -2563,11 +2563,12 @@ static frontend *new_window(char *arg, int argtype, char **error)
            (GTK_STATUSBAR(fe->statusbar), "game");
        gtk_statusbar_push(GTK_STATUSBAR(fe->statusbar), fe->statusctx,
                           "test");
+#if GTK_CHECK_VERSION(3,0,0)
+       gtk_widget_get_preferred_size(fe->statusbar, &req, NULL);
+#else
        gtk_widget_size_request(fe->statusbar, &req);
-#if 0
-       /* For GTK 2.0, should we be using gtk_widget_set_size_request? */
 #endif
-       gtk_widget_set_usize(viewport, -1, req.height);
+       gtk_widget_set_size_request(viewport, -1, req.height);
     } else
        fe->statusbar = NULL;