As referenced in my previous question, I am trying to make something slightly wizard-like in function. I have settled on a single frame with a sizer added to it. I build panel
I think I figured it out. Instead of calls to the Show
and Hide
methods of the panels, you need to call the Show
and Hide
methods of the root sizer:
self.Show()
becomes
self.GetParent().GetSizer().Show(self)
...and so on.
Also, after each call, you need
self.GetParent().GetSizer().Layout()
Yeah, I know this is already answered, but here you go anyway:
You should only have to call Layout() on the panel's parent, so something like self.GetParent().Layout() should do the trick. See this article: http://www.blog.pythonlibrary.org/2010/06/16/wxpython-how-to-switch-between-panels/
If you want the buttons to always show, create two panels in one vertical sizer. The one on top will show your panels and the one on the bottom will show the buttons. Then use PubSub or something to communicate between them.