X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/73470a17475531b34303622f4e1d76f0755903c5..0a5bb138a71dfc1c706fc0858fb2801500e2c2e8:/wxPython/demo/CollapsiblePane.py diff --git a/wxPython/demo/CollapsiblePane.py b/wxPython/demo/CollapsiblePane.py index 4e0b993a3a..15ab9ad54a 100644 --- a/wxPython/demo/CollapsiblePane.py +++ b/wxPython/demo/CollapsiblePane.py @@ -39,8 +39,13 @@ class TestPanel(wx.Panel): def OnPaneChanged(self, evt=None): - self.log.write('wx.EVT_COLLAPSIBLEPANE_CHANGED') + if evt: + self.log.write('wx.EVT_COLLAPSIBLEPANE_CHANGED: %s' % evt.Collapsed) + + # redo the layout self.Layout() + + # and also change the labels if self.cp.IsExpanded(): self.cp.SetLabel(label2) self.btn.SetLabel(btnlbl2) @@ -65,8 +70,6 @@ class TestPanel(wx.Panel): zip = wx.TextCtrl(pane, -1, "", size=(70,-1)); addrSizer = wx.FlexGridSizer(cols=2, hgap=5, vgap=5) - addrSizer.Add((10,10)) - addrSizer.Add((10,10)) addrSizer.AddGrowableCol(1) addrSizer.Add(nameLbl, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL) @@ -74,7 +77,7 @@ class TestPanel(wx.Panel): addrSizer.Add(addrLbl, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL) addrSizer.Add(addr1, 0, wx.EXPAND) - addrSizer.Add((10,10)) + addrSizer.Add((5,5)) addrSizer.Add(addr2, 0, wx.EXPAND) addrSizer.Add(cstLbl, 0, @@ -86,7 +89,9 @@ class TestPanel(wx.Panel): cstSizer.Add(zip) addrSizer.Add(cstSizer, 0, wx.EXPAND) - pane.SetSizer(addrSizer) + border = wx.BoxSizer() + border.Add(addrSizer, 1, wx.EXPAND|wx.ALL, 5) + pane.SetSizer(border)