diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2012-06-08 10:13:42 -0500 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2012-06-08 10:13:42 -0500 |
commit | a96d7a23389ff869fda42076a30f4d397fd52dd0 (patch) | |
tree | 5ae5c8a94d2f8246e375a631135aaf3d5509adcf /hildon/hildon-pannable-area.c | |
parent | a9441b7390d9afd6dc02b3dc81187ec9e0f3be47 (diff) |
Fix hildon_pannable_area_add.
Calling gtk_container_add is not the correct way to chain
up to GtkBin's container_class->add. This just causes
hildon_pannable_area_add to be called again and we're in
an infinite loop. In-tree widgets have the lovely convenience
function _gtk_bin_add_child but we can't call that so we have
to jump through these hoops.
Diffstat (limited to 'hildon/hildon-pannable-area.c')
-rw-r--r-- | hildon/hildon-pannable-area.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hildon/hildon-pannable-area.c b/hildon/hildon-pannable-area.c index c58937f..6a2f650 100644 --- a/hildon/hildon-pannable-area.c +++ b/hildon/hildon-pannable-area.c @@ -200,6 +200,8 @@ enum { PROP_LAST }; +static GtkBinClass *bin_class = NULL; + static void hildon_pannable_area_class_init (HildonPannableAreaClass * klass); static void hildon_pannable_area_init (HildonPannableArea * area); static void hildon_pannable_area_get_property (GObject * object, @@ -320,6 +322,7 @@ hildon_pannable_area_class_init (HildonPannableAreaClass * klass) GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass); + bin_class = g_type_class_peek (GTK_TYPE_BIN); g_type_class_add_private (klass, sizeof (HildonPannableAreaPrivate)); @@ -2920,8 +2923,7 @@ hildon_pannable_area_add (GtkContainer *container, GtkWidget *child) g_return_if_fail (gtk_bin_get_child (GTK_BIN (container)) == NULL); - gtk_widget_set_parent (child, GTK_WIDGET (container)); - gtk_container_add (container, child); + GTK_CONTAINER_CLASS (bin_class)->add (container, child); g_signal_connect_after (child, "map-event", G_CALLBACK (hildon_pannable_area_child_mapped), |