Modifying the size of a StaticBox inside a StaticBoxSizer

I've got a StaticBox inside a StaticBoxSizer.

        box = wx.StaticBox(self, wx.ID_ANY, "wxRocks")
        boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)

the StaticBox is occupying the entire size of the panel it is mounted
on.
I've tried making the StaticBox smaller, but it ignores the size
arguments, as in ...

        box = wx.StaticBox(self, wx.ID_ANY, "wxRocks", size=(100,50) )
        boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)

Why is the StaticBox ignoring the size parameters?
How do I change the size of the StaticBox?

···

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

I've got a StaticBox inside a StaticBoxSizer.

         box = wx.StaticBox(self, wx.ID_ANY, "wxRocks")
         boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)

the StaticBox is occupying the entire size of the panel it is mounted
on.
I've tried making the StaticBox smaller, but it ignores the size
arguments, as in ...

         box = wx.StaticBox(self, wx.ID_ANY, "wxRocks", size=(100,50) )
         boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)

Why is the StaticBox ignoring the size parameters?

Because the sizer is (re)setting its size.

How do I change the size of the StaticBox?

It sounds like this sizer is the top level one assigned to the panel, so it is being given the all of the panel's space. If you don't want that then you can use a new sizer assigned ot the panel and then put this staticboxsizer to the new one with flags and/or borders to size and position the staticboxsizer where you want it. Using the WIT will help you visualize how/why the sizers are doing what they are doing.

http://wiki.wxpython.org/Widget_Inspection_Tool

···

On 5/5/10 11:20 AM, cappy2112 wrote:

--
Robin Dunn
Software Craftsman

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en