-- Regards David Hughes Forestfield Software
What about just hiding the wx.StaticBox instance? The sizer can not be hidden as it is never really shown.
Or do I understand you not correctly?
If you put the StaticBox etc on a Panel, then you should be able to hide it all by 'just' hiding the panel.
Werner
Hi Werner,The StaticBoxSizer (or Stationmaster as my spell checker want to call it) draws a box around the controls inside it and optionally displays a label, so I would like to hide these as well otherwise I am left with (in my case) quite a large empty box.
On 06/08/2014 16:37, Werner wrote:
What about just hiding the wx.StaticBox instance? The sizer can not be hidden as it is never really shown.
Or do I understand you not correctly?
If you put the StaticBox etc on a Panel, then you should be able to hide it all by 'just' hiding the panel.
Werner
self.stbz.Hide()
Traceback (most recent call last):
File "<string>", line 1, in <fragment>
TypeError: Hide() takes at least 2 arguments (1 given)
I assume the 1 argument is self, but what else is it expecting?
Layout. The item
parameter can be either a window, a sizer, or the zero-based index of
the item. Use the recursive parameter to show or hide an item in a
subsizer. Returns True if the item was found.II was hoping to avoid the hassle of using panels but I'll do that if necessary.
Since the staticbox should be the other widgets' parent, you should be able to hide just that.
http://www.wxpython.org/docs/api/wx.StaticBoxSizer-class.html
I am using 2.9 and unable to to get it to work. It turns out though that in the situation where I thought the controls in the box sizer were not needed there is one case where they are, so I have to keep it visible anyway.
On 07/08/2014 09:12, Werner wrote:
If I use Phoenix then both button handlers work for me, if I use 2.8 then only the second one works. I guess that makes sense as under 2.8 the items in the staticbox are siblings of it and not children.
The Phoenix method of creating a staticbox/sizer should work as of 2.9 but I couldn't make it work in my little test I attach.