Hiding controls

Add the 3 lines above to your OnButton handler:

def OnButton(self, event):
   """Show/Hide the row of buttons and the static

box"""

   (...)
   parent = self.GetParent()
   parent.Fit()
   parent.SendSizeEvent()

Thanks for the reply.

This isn't quite the behavior I'm looking for because
the controls static box jumps around each time the
toggle button is pressed. If you leave these lines
commented out...

# val = not self.toggleButton.GetValue()
# self.toggleButton.SetValue(val)
# self.OnButton(wx.PyEvent())

...and run through it you'll get an idea of what I'm
trying to do as far as the layout is concerned.

I don't see this behavior.
I'm using wxPython-2.6.1.1pre.20050615/gtk2/unicode

That's odd. If it helps, this is what I get for the
following...

import wx
print wx.__version__

2.6.1.2pre

···

__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005

Add the lines marked with plus sign in MyFrame.__init__, and see if it's
the behavior you want.

   self.button3 = wx.Button(self, ID_BUTTON3, 'Button 3')
   self.btnSizer.Add(self.button3, 0, wx.ALIGN_CENTER|wx.ALL, 5)

+ self.btnSizer.Add((0,self.button3.GetSize()[1]), 0,
+ wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM, 5)

···

On Mon, 2005-09-12 at 11:18 -0700, Vernon Dozier wrote:

This isn't quite the behavior I'm looking for because
the controls static box jumps around each time the
toggle button is pressed. If you leave these lines
commented out...

# val = not self.toggleButton.GetValue()
# self.toggleButton.SetValue(val)
# self.OnButton(wx.PyEvent())

+
+ self.topSizer.Add((self.button3.GetSize()[0]*3+40,0), 0,
+ wx.ALIGN_CENTER|wx.LEFT|wx.RIGHT, 5)
   self.topSizer.Add(self.btnSizer, 0, wx.ALIGN_CENTER|wx.ALL, 5)

   # On linux/GTK, the static box doesn't inherit the background

...and run through it you'll get an idea of what I'm
trying to do as far as the layout is concerned.

>I don't see this behavior.
>I'm using wxPython-2.6.1.1pre.20050615/gtk2/unicode

That's odd. If it helps, this is what I get for the
following...

>>> import wx
>>> print wx.__version__
2.6.1.2pre

Where did you get that version? The last one that Robin releases, is the
one I have, at least I think.

Ricardo