parent
5c3df2730b
commit
263c5a5b31
@ -0,0 +1,36 @@
|
||||
diff -up wxWidgets-3.0.2/src/gtk/win_gtk.cpp.size-alloc-fix wxWidgets-3.0.2/src/gtk/win_gtk.cpp
|
||||
--- wxWidgets-3.0.2/src/gtk/win_gtk.cpp.size-alloc-fix 2016-04-04 14:55:37.647728846 -0400
|
||||
+++ wxWidgets-3.0.2/src/gtk/win_gtk.cpp 2016-04-04 14:56:36.199637226 -0400
|
||||
@@ -192,8 +192,24 @@ static void pizza_remove(GtkContainer* c
|
||||
}
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
+// Get preferred size of children, to avoid GTK+ warnings complaining
|
||||
+// that they were size-allocated without asking their preferred size
|
||||
+static void children_get_preferred_size(const GList* p)
|
||||
+{
|
||||
+ for (; p; p = p->next)
|
||||
+ {
|
||||
+ const wxPizzaChild* child = static_cast<wxPizzaChild*>(p->data);
|
||||
+ if (gtk_widget_get_visible(child->widget))
|
||||
+ {
|
||||
+ GtkRequisition req;
|
||||
+ gtk_widget_get_preferred_size(child->widget, &req, NULL);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void pizza_get_preferred_width(GtkWidget* widget, int* minimum, int* natural)
|
||||
{
|
||||
+ children_get_preferred_size(WX_PIZZA(widget)->m_children);
|
||||
*minimum = 0;
|
||||
gtk_widget_get_size_request(widget, natural, NULL);
|
||||
if (*natural < 0)
|
||||
@@ -202,6 +218,7 @@ static void pizza_get_preferred_width(Gt
|
||||
|
||||
static void pizza_get_preferred_height(GtkWidget* widget, int* minimum, int* natural)
|
||||
{
|
||||
+ children_get_preferred_size(WX_PIZZA(widget)->m_children);
|
||||
*minimum = 0;
|
||||
gtk_widget_get_size_request(widget, NULL, natural);
|
||||
if (*natural < 0)
|
Loading…
Reference in new issue