diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index 1df1ec244a..7c8d9afd75 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -395,6 +395,20 @@ gtk_stack_page_set_property (GObject *object, break; } } + +static void +gtk_stack_page_constructed (GObject *gobject) +{ + GtkStackPage *self = GTK_STACK_PAGE (gobject); + + if (G_UNLIKELY (self->widget == NULL)) + g_error ("GtkStackPage '%s' [%p] is missing a child widget", + self->name != NULL ? self->name : "", + self); + + G_OBJECT_CLASS (gtk_stack_page_parent_class)->constructed (gobject); +} + static void gtk_stack_page_class_init (GtkStackPageClass *class) { @@ -404,6 +418,7 @@ gtk_stack_page_class_init (GtkStackPageClass *class) object_class->dispose = gtk_stack_page_dispose; object_class->get_property = gtk_stack_page_get_property; object_class->set_property = gtk_stack_page_set_property; + object_class->constructed = gtk_stack_page_constructed; /** * GtkStackPage:child: (attributes org.gtk.Property.get=gtk_stack_page_get_child) @@ -2627,7 +2642,7 @@ gtk_stack_measure (GtkWidget *widget, int min_for_size; gtk_widget_measure (child, OPPOSITE_ORIENTATION (orientation), -1, &min_for_size, NULL, NULL, NULL); - + gtk_widget_measure (child, orientation, MAX (min_for_size, for_size), &child_min, &child_nat, NULL, NULL); } else