X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d13b34d3f2be575d59747a5926000be7b28a45dc..bb996f289574defb0ae4339ae8e46ff3cf6fa54c:/src/gtk/collpane.cpp diff --git a/src/gtk/collpane.cpp b/src/gtk/collpane.cpp index a902d113a3..cfda20564c 100644 --- a/src/gtk/collpane.cpp +++ b/src/gtk/collpane.cpp @@ -24,7 +24,9 @@ #include "wx/sizer.h" #include "wx/panel.h" +#include #include "wx/gtk/private.h" +#include "wx/gtk/private/gtk2-compat.h" // the lines below duplicate the same definitions in collpaneg.cpp, if we have // another implementation of this class we should extract them to a common file @@ -200,7 +202,6 @@ bool wxCollapsiblePane::Create(wxWindow *parent, m_pPane = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxNO_BORDER, wxS("wxCollapsiblePanePane")); - gtk_widget_show(m_widget); m_parent->DoAddChild( this ); PostCreation(size); @@ -221,10 +222,12 @@ wxSize wxCollapsiblePane::DoGetBestSize() const wxASSERT_MSG( m_widget, wxT("DoGetBestSize called before creation") ); GtkRequisition req; - req.width = 2; - req.height = 2; - (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_widget) )->size_request ) - (m_widget, &req ); +#ifdef __WXGTK3__ + gtk_widget_get_preferred_width(m_widget, NULL, &req.width); + gtk_widget_get_preferred_height_for_width(m_widget, req.width, NULL, &req.height); +#else + GTK_WIDGET_GET_CLASS(m_widget)->size_request(m_widget, &req); +#endif // notice that we do not cache our best size here as it changes // all times the user expands/hide our pane