X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ba6a836246ee6768c29d50adfe9fee30221da8e..c56ae04274fda26269c6d06be34cf59a45eb70ce:/src/gtk/win_gtk.c diff --git a/src/gtk/win_gtk.c b/src/gtk/win_gtk.c index 71ee98747c..85c77d7c02 100644 --- a/src/gtk/win_gtk.c +++ b/src/gtk/win_gtk.c @@ -13,7 +13,7 @@ #define XCheckIfEvent XCHECKIFEVENT #endif -#include "wx/defs.h" +#include "wx/platform.h" #include "wx/gtk/win_gtk.h" #include "gtk/gtksignal.h" #include "gtk/gtkprivate.h" @@ -306,7 +306,7 @@ gtk_pizza_put (GtkPizza *pizza, gtk_widget_set_parent (widget, GTK_WIDGET (pizza)); - gtk_widget_set_usize (widget, width, height); + gtk_widget_set_size_request (widget, width, height); } void @@ -370,7 +370,7 @@ gtk_pizza_resize (GtkPizza *pizza, child->width = width; child->height = height; - gtk_widget_set_usize (widget, width, height); + gtk_widget_set_size_request (widget, width, height); if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (pizza)) gtk_widget_queue_resize (widget); @@ -394,6 +394,16 @@ gtk_pizza_set_size (GtkPizza *pizza, g_return_if_fail (GTK_IS_PIZZA (pizza)); g_return_if_fail (widget != NULL); +#ifndef WX_WARN_ILLEGAL_SETSIZE + /* this really shouldn't happen -- but it does, a lot, right now and we + can't pass negative values to gtk_widget_set_size_request() without getting + a warning printed out, so filter them out here */ + if ( width < 0 ) + width = 0; + if ( height < 0 ) + height = 0; +#endif + children = pizza->children; while (children) { @@ -412,7 +422,7 @@ gtk_pizza_set_size (GtkPizza *pizza, child->width = width; child->height = height; - gtk_widget_set_usize (widget, width, height); + gtk_widget_set_size_request (widget, width, height); if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (pizza)) gtk_widget_queue_resize (widget);