From: Ben Pfaff Date: Sat, 7 May 2011 03:56:18 +0000 (-0700) Subject: gui: Provide substitute for gtk_widget_get_realized() for GTK+ < 2.20. X-Git-Tag: v0.7.9~319 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef7f207a277f2fa2710115bd21b9c2147860f5af;p=pspp-builds.git gui: Provide substitute for gtk_widget_get_realized() for GTK+ < 2.20. Problem reported by "Mindaugas Baranauskas" . --- diff --git a/src/ui/gui/psppire-buttonbox.c b/src/ui/gui/psppire-buttonbox.c index a6b00689..1c692d42 100644 --- a/src/ui/gui/psppire-buttonbox.c +++ b/src/ui/gui/psppire-buttonbox.c @@ -81,6 +81,26 @@ set_default (PsppireButtonBox *bb) } } +#if !GTK_CHECK_VERSION(2,20,0) +/** + * gtk_widget_get_realized: + * @widget: a #GtkWidget + * + * Determines whether @widget is realized. + * + * Return value: %TRUE if @widget is realized, %FALSE otherwise + * + * Since: 2.20 + **/ +static inline gboolean +gtk_widget_get_realized (GtkWidget *widget) +{ + g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); + + return (GTK_WIDGET_FLAGS (widget) & GTK_REALIZED) != 0; +} +#endif /* gtk < 2.20 */ + static void psppire_buttonbox_set_property (GObject *object, guint prop_id,