[wxPython-users] Removing components from a gridbagsizer

Frank Millman frank at chagford.com
Thu Jun 1 02:57:20 PDT 2006


Julian Swartz wrote:

>That doesn't work. Consider the test program below. I have a GridBagSizer
managing a 2x2 grid containing 2 buttons and 2 >StaticText labels. I want to
be able to make button 2 disappear by clicking button 1, but when I use the
Detach method,
>nothing happens. If I add the line self.sizer.Layout() to the end of the
button_clicked() method, button 2 is still
>visible and the items merely get realigned in the grid.
>
>Any ideas?
>

Have you checked GridBagSizer in the demo? It demonstrates hiding and
showing a text control. It may be what you are looking for.

Frank Millman





More information about the wxpython-users mailing list