wxSizer: Define sizer hierarchie before putting controls in or vice versa?

Tom B. sbabbitt at commspeed.net
Fri Sep 10 09:44:19 EDT 2004


"Piet" <pit.grinja at gmx.de> wrote in message 
news:39cbe663.0409050623.5cef2d4d at posting.google.com...
> Hello,
> I have a short question about sizers and how they work when I have a
> frame or panel with a complex sizer hierarchie. When creating a new
> sizer which sits itself in its parent sizer, should I add the new
> sizer to the parent sizer and then populate the new sizer with its
> controls (some of them might be sizers on their own) or should I
> populate the new sizer with all its controls before I add the new
> sizer to its parent sizer? Or doesn´t it make any difference and all
> the sizes and sizers are calculated anyways when the
> wx.Window.SetSizer(wx.Sizer),wx.Window.SetAutoLayout(True) and
> wx.Sizer.Fit(wx.Window) functions are run before before the window is
> finally made visible?
> Thanx in advance
> Peter

I like to bunch everything together so its easier to see later.

#
self.linkpanel = wx.Panel(self.notebook,-1)
self.link_thing = LinkListCtrlPanel(self.linkpanel)
 txtbox = wx.BoxSizer(wx.HORIZONTAL)
txtbox.Add(self.link_thing, 2, wx.EXPAND)
self.linkpanel.SetSizer(txtbox)
self.linkpanel.SetAutoLayout(1)
txtbox.Fit(self.linkpanel)
self.notebook.AddPage(self.linkpanel, "Links")
#

Tom 





More information about the Python-list mailing list