gui: Provide substitute for gtk_widget_get_realized() for GTK+ < 2.20.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 7 May 2011 03:56:18 +0000 (20:56 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 7 May 2011 03:56:56 +0000 (20:56 -0700)
Problem reported by "Mindaugas Baranauskas" <embar@super.lt>.

src/ui/gui/psppire-buttonbox.c

index a6b006899bb7bd9704e20507d29a763233be758b..1c692d42ba2e5af8533398c6962c95b4acf432b1 100644 (file)
@@ -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,