diff options
author | Matthias Clasen <mclasen@redhat.com> | 2011-04-16 13:57:05 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2011-05-06 14:29:14 -0400 |
commit | deb271d35519124509103ccc4c217bb31bf4fe65 (patch) | |
tree | 9b3bb32bc80c02b84364e6bc36b66c51711af941 /gtk/gtkwidget.c | |
parent | c8c1075cfe7220be0b82b81358c3bb8bc375e11c (diff) | |
download | gtk+-deb271d35519124509103ccc4c217bb31bf4fe65.tar.gz |
Add gtk_container_child_notify
This is a variant of gtk_widget_child_notify() that takes an
explicit container, instead of relying on widget->parent to
be the correct container to use.
Diffstat (limited to 'gtk/gtkwidget.c')
-rw-r--r-- | gtk/gtkwidget.c | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 575c9594c7..db2b824e6e 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -3587,37 +3587,17 @@ gtk_widget_freeze_child_notify (GtkWidget *widget) * on @widget. * * This is the analogue of g_object_notify() for child properties. - **/ + * + * Also see gtk_container_child_notify(). + */ void gtk_widget_child_notify (GtkWidget *widget, - const gchar *child_property) + const gchar *child_property) { - GtkWidgetPrivate *priv = widget->priv; - GParamSpec *pspec; - - g_return_if_fail (GTK_IS_WIDGET (widget)); - g_return_if_fail (child_property != NULL); - if (!G_OBJECT (widget)->ref_count || !priv->parent) + if (widget->priv->parent == NULL) return; - g_object_ref (widget); - pspec = g_param_spec_pool_lookup (_gtk_widget_child_property_pool, - child_property, - G_OBJECT_TYPE (priv->parent), - TRUE); - if (!pspec) - g_warning ("%s: container class `%s' has no child property named `%s'", - G_STRLOC, - G_OBJECT_TYPE_NAME (priv->parent), - child_property); - else - { - GObjectNotifyQueue *nqueue = g_object_notify_queue_freeze (G_OBJECT (widget), _gtk_widget_child_property_notify_context); - - g_object_notify_queue_add (G_OBJECT (widget), nqueue, pspec); - g_object_notify_queue_thaw (G_OBJECT (widget), nqueue); - } - g_object_unref (widget); + gtk_container_child_notify (GTK_CONTAINER (widget->priv->parent), widget, child_property); } /** |