Sizers / Panel

Mark Erbaugh mark at microenh.com
Mon Feb 4 12:48:38 PST 2008


I think I needs some help in understanding sizers (or someone to tell me
that my thinking is correct).

I create a frame that has a panel taking up the entire client area.  The
contents of the panel are managed by sizers.  After laying out the
contents, I do:

panel.SetSizer(sizer)

However, I find that I need to add another sizer to "link" the panel
sizers to the frame and to get the form to adjust to the size of the
panel.

sizer1 = wx.BoxSizer(wx.Sizer)
sizer1.Add(panel)
frame.SetSizer(sizer1)
frame.Fit()

Is this the correct approach?

Mark






More information about the wxpython-users mailing list