[wxPython-users] Removing components from a gridbagsizer

Peter Decker pydecker at gmail.com
Thu Jun 1 04:37:37 PDT 2006


On 6/1/06, Julian Swartz <swartzjp at gmail.com> 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.

Oh, you want to get rid of the items. I thought you only wanted to
remove them from the grid. Can't you just call button.Show(False),
followed by grid.Layout()?

-- 

# p.d.




More information about the wxpython-users mailing list