I'm writing a program using Boa Constructor. At the moment there are
three main files: main.py (the main wxApp file), intro_choices.py (the
opening frame) and cdcat.py (called from intro_choices.py). Here is
the code I use (in intro_choices.py) to make and show a frame defined in cdcat.py:
Now that's all fine except when you close the addFrame then I want it
to be destroyed and the other frame to Show() itself again. What is the best
way to do this?
I'm writing a program using Boa Constructor. At the moment there are
three main files: main.py (the main wxApp file), intro_choices.py (the
opening frame) and cdcat.py (called from intro_choices.py). Here is
the code I use (in intro_choices.py) to make and show a frame defined in cdcat.py:
import cdcat # etc.
<snip>
def on_btnAdd(self, event):
addFrame = cdcat.wxFrame1(self)
addFrame.Show();addFrame.Hide();addFrame.Show()
self.Hide()
Now that's all fine except when you close the addFrame then I want it
to be destroyed and the other frame to Show() itself again. What is the best
way to do this?
Give the addFrame a handler for EVT_CLOSE and in there call Show on the other frame. Be sure to calso call event.Skip() so the default handler for the event will still run.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Well I knew that part but the problem is how do I reference the previous frame?
--Wayne
···
Wayne Koorts wrote:
Hi,
I'm writing a program using Boa Constructor. At the moment there are
three main files: main.py (the main wxApp file), intro_choices.py (the
opening frame) and cdcat.py (called from intro_choices.py). Here is
the code I use (in intro_choices.py) to make and show a frame defined in cdcat.py:
Now that's all fine except when you close the addFrame then I want it
to be destroyed and the other frame to Show() itself again. What is the best
way to do this?
Give the addFrame a handler for EVT_CLOSE and in there call Show on the
other frame. Be sure to calso call event.Skip() so the default handler
for the event will still run.
Well I knew that part but the problem is how do I reference the previous frame?
Save a reference to it somewhere like any other variable that you want to keep track of. Or if you don't like to do that for some reason then use GetParent() in the close handler.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Wednesday, September 17, 2003, 9:20:46 PM, you wrote:
···
Wayne Koorts wrote:
Well I knew that part but the problem is how do I reference the previous frame?
Save a reference to it somewhere like any other variable that you want
to keep track of. Or if you don't like to do that for some reason then
use GetParent() in the close handler.