StaticBoxSizer problems

Matthias Kluwe mkluwe at gmail.com
Thu Mar 9 16:47:24 CET 2006


Hi!

> Matthias Kluwe wrote:
>> I'd like to place several StaticBoxes in a frame, but I can't get it
>> right.

>> Consider the following code:
>
>> import wx
>
>> app = wx.PySimpleApp()
>> frame = wx.Frame(parent=None, title="Test")
>> box = wx.BoxSizer(wx.VERTICAL)
>> frame.SetSizer(box)
>> upper_box = wx.StaticBox(parent=frame, label="Upper Box")
>> box.Add(item=upper_box, flag=wx.GROW)
>
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> You should remiove this line.

Hmm. As I see it, this means constructing the StaticBox and not placing
it in the frame. Obviously, this does not help.

> [...]
>
>> What am I missing?
>
> Generally speaking what you appear to be missing is a methodical
> approach to GUI consruction. This reminds me of a lot of my early
> experiments with wxPython code :-)

"a methodical approach to GUI construction"? Please be more specific --
any hints are welcome. Clearly, the above is an experiment with
wxPython, not anything methodical. This may follow when I understand
how StaticBoxSizer works.

Regards,
Matthias




More information about the Python-list mailing list