diff --git a/wx/lib/agw/pycollapsiblepane.py b/wx/lib/agw/pycollapsiblepane.py index 26437ec8..41a441fe 100644 --- a/wx/lib/agw/pycollapsiblepane.py +++ b/wx/lib/agw/pycollapsiblepane.py @@ -481,8 +481,6 @@ class PyCollapsiblePane(wx.Panel): :param `sz`: an instance of :class:`Size`. """ - # minimal size has priority over the best size so set here our min size - self.SetMinSize(sz) self.SetSize(sz) if self.HasAGWFlag(wx.CP_NO_TLW_RESIZE): @@ -534,7 +532,7 @@ class PyCollapsiblePane(wx.Panel): # collapsed . expanded transition # force our parent to "fit", i.e. expand so that it can honour - # our minimal size + # our best size top.Fit() @@ -554,6 +552,8 @@ class PyCollapsiblePane(wx.Panel): # update our state self._pPane.Show(not collapse) self._bCollapsed = collapse + self.InvalidateBestSize() + self.Thaw() # update button label @@ -603,7 +603,8 @@ class PyCollapsiblePane(wx.Panel): self._pButton.SetLabel(self.GetBtnLabel()) self._pButton.SetInitialSize() self._pButton.Refresh() - + self.InvalidateBestSize() + self.Layout() @@ -625,6 +626,7 @@ class PyCollapsiblePane(wx.Panel): """ self._pButton.SetFont(font) + self.InvalidateBestSize() self.Layout() @@ -656,6 +658,7 @@ class PyCollapsiblePane(wx.Panel): """ self._expanderDimensions = width, height + self.InvalidateBestSize() if self._sz: self._sz.Layout() if self._pButton: @@ -778,6 +781,7 @@ class PyCollapsiblePane(wx.Panel): if self._pPane: self._pButton.MoveBeforeInTabOrder(self._pPane) + self.InvalidateBestSize() self.Layout()