From ef03dc3fc6c72cf092b8b0ee95940e33f2ff9299 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 29 Oct 2010 12:58:24 -0400 Subject: [PATCH] Don't set get_preferred_width_for_height to NULL The size request machinery expects that it is non-NULL. --- gtk/gtkbbox.c | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c index f1531b1eef..045a3a2288 100644 --- a/gtk/gtkbbox.c +++ b/gtk/gtkbbox.c @@ -81,12 +81,21 @@ static void gtk_button_box_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); -static void gtk_button_box_get_preferred_width (GtkWidget *widget, - gint *minimum, - gint *natural); -static void gtk_button_box_get_preferred_height (GtkWidget *widget, - gint *minimum, - gint *natural); +static void gtk_button_box_get_preferred_width (GtkWidget *widget, + gint *minimum, + gint *natural); +static void gtk_button_box_get_preferred_height (GtkWidget *widget, + gint *minimum, + gint *natural); +static void gtk_button_box_get_preferred_width_for_height (GtkWidget *widget, + gint height, + gint *minimum, + gint *natural); +static void gtk_button_box_get_preferred_height_for_width (GtkWidget *widget, + gint width, + gint *minimum, + gint *natural); + static void gtk_button_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void gtk_button_box_remove (GtkContainer *container, @@ -126,8 +135,8 @@ gtk_button_box_class_init (GtkButtonBoxClass *class) widget_class->get_preferred_width = gtk_button_box_get_preferred_width; widget_class->get_preferred_height = gtk_button_box_get_preferred_height; - widget_class->get_preferred_width_for_height = NULL; - widget_class->get_preferred_height_for_width = NULL; + widget_class->get_preferred_width_for_height = gtk_button_box_get_preferred_width_for_height; + widget_class->get_preferred_height_for_width = gtk_button_box_get_preferred_height_for_width; widget_class->size_allocate = gtk_button_box_size_allocate; container_class->remove = gtk_button_box_remove; @@ -643,6 +652,24 @@ gtk_button_box_get_preferred_height (GtkWidget *widget, *minimum = *natural = requisition.height; } +static void +gtk_button_box_get_preferred_width_for_height (GtkWidget *widget, + gint height, + gint *minimum, + gint *natural) +{ + gtk_button_box_get_preferred_width (widget, minimum, natural); +} + +static void +gtk_button_box_get_preferred_height_for_width (GtkWidget *widget, + gint width, + gint *minimum, + gint *natural) +{ + gtk_button_box_get_preferred_height (widget, minimum, natural); +} + static void gtk_button_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation)