Discussion:
start new wxframe
pluto mars
2014-10-17 19:30:29 UTC
Permalink
Hi All,

I would like to make an application on which there is a 'main' panel
containing buttons. When a button is pressed, I would like to be able to
create a new frame with panel with new functionalities like displaying a
picture with buttons and textboxes. However I want the main frame not be
'reactive' as long as the user has not closed the 'new' frame. Its like
starting a 'function' by pressing the button and that it will return after
that function has finished. The function then finished after the user has
performed its activities on the new frame and closed it. I want to be able
also to communicate between the new frame and the main frame. For example
if in the new frame there is a filedialog, I want to be able to pass the
chosen file to the main frame.

Is it possible to do this and does anyone has an example for me on how to
realised this ?

Thanks in advance.

Pluto.
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robin Dunn
2014-10-17 20:33:55 UTC
Permalink
Post by pluto mars
Hi All,
I would like to make an application on which there is a 'main' panel
containing buttons. When a button is pressed, I would like to be able to
create a new frame with panel with new functionalities like displaying a
picture with buttons and textboxes. However I want the main frame not be
'reactive' as long as the user has not closed the 'new' frame. Its like
starting a 'function' by pressing the button and that it will return
after that function has finished. The function then finished after the
user has performed its activities on the new frame and closed it.I want
to be able also to communicate between the new frame and the main frame.
For example if in the new frame there is a filedialog, I want to be able
to pass the chosen file to the main frame.
You can call Disable on the main frame (or its panel) when the new frame
is shown, and Enable when the new one is closed (EVT_CLOSE will help
you.) To pass data back to the main frame your worker frames can simply
call some method of the main frame when the workers are closed, and pass
whatever data is relevant.

On the other hand, you may just want to make all your workers be Dialogs
instead of Frames. Then you just call the dialog's ShowModal method,
which wont return to the caller until the user has completed or canceled
the dialog. Then the calling code can react accordingly, including
fetching data from dialog, etc. Modal dialogs will automatically
prevent interaction with other frames in the application.
--
Robin Dunn
Software Craftsman
http://wxPython.org
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...