All,
What happens with wx.EXPAND when sizers are nested? Consider:
wred = ColWin(self, wx.ID_ANY, wx.RED)
wwhite = ColWin(self, wx.ID_ANY, wx.WHITE)
h = 40
b1 = wx.Button(self, wx.ID_ANY, '1', wx.DefaultPosition, (-1, h))
b2 = wx.Button(self, wx.ID_ANY, '2', wx.DefaultPosition, (-1, h))
b3 = wx.Button(self, wx.ID_ANY, '3', wx.DefaultPosition, (-1, h))
b4 = wx.Button(self, wx.ID_ANY, '4', wx.DefaultPosition, (-1, h))
b5 = wx.Button(self, wx.ID_ANY, '', wx.DefaultPosition, (-1, h))
b5.Enable(False)
hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
b = 0
f = wx.ALL
hsizer1.Add(b1, 0, f, border=b)
hsizer1.Add(b2, 0, f, border=b)
hsizer1.Add(b3, 0, f, border=b)
hsizer1.Add(b4, 0, f, border=b)
hsizer1.Add(b5, 1, f, border=b)
b = 2
hsizer2 = wx.BoxSizer(wx.HORIZONTAL)
hsizer2.Add(wred, 1, wx.EXPAND | wx.RIGHT, b)
hsizer2.Add(wwhite, 1, wx.EXPAND | wx.LEFT, b)
b = 5
vsizer1 = wx.BoxSizer(wx.VERTICAL)
vsizer1.Add(hsizer1, 0, wx.EXPAND | wx.RIGHT, b)
vsizer1.Add(hsizer2, 1, wx.EXPAND | wx.ALL, b)
self.SetSizer(vsizer1)
Why do I need these:
vsizer1.Add(hsizer1, 0, wx.EXPAND | wx.RIGHT, b)
vsizer1.Add(hsizer2, 1, wx.EXPAND | wx.ALL, b)
To allow these to expand horizontally:
hsizer2.Add(wred, 1, wx.EXPAND | wx.RIGHT, b)
hsizer2.Add(wwhite, 1, wx.EXPAND | wx.LEFT, b)
Can anyone summarize what to expect regarding wx.EXPAND when sizers are nested?
Thanks.
David.