StaticBoxSizer problems

Matthias Kluwe mkluwe at gmail.com
Fri Mar 10 12:28:43 EST 2006


Hi!

Steve Holden wrote:
> Did you actually try removing the line and running the program?

I tried, of course :-) Removing the line

box.Add(item=upper_box, flag=wx.GROW)

yields the remaining program

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")
upper_sizer = wx.StaticBoxSizer(upper_box)
upper_sizer.Add(wx.Button(parent=frame, label="Button"))
frame.Show()
app.MainLoop()

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

> Guess what: the button appears inside the static box sizer. And your problem
> with that would be ... ?

... the StaticBox not being displayed.

>> "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.

> Well, "methodical" would seem to include testing the suggestions of
> well-meaning fellow netizens, for a start, rather than using your
> psychic powers to predict results.

No prediction needed :-) I can't see how I have suggested you're not
well-meaning.

Regards,
Matthias




More information about the Python-list mailing list