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 ?
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.
I understand how I can achieved this with a custom dialog. BUt lets say I have on the custom dialog a bitmap displayed. And next to the bitmap a texctrl box and some other buttons. But now instead of having the bitmap + all other controls to be in a single dialog, I would like the bitmap and its zoom control slider in a separate dialog, and then all other controls in another dialog, but they would act as if they are on one dialog ?.
So, in principal, instead of one big dialog with all controls, I want multiple dialogs but the controls acting as if they are on one dialog. I want also only one close button, which if you click on it, all dialogs will close.
Thank you again,
pluto
···
On Friday, October 17, 2014 9:30:29 PM UTC+2, pluto mars wrote:
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 ?
Since everything in wxPython is event-driven, you just need to tell GUI-A’s button event to do some work on some GUI-B object you had previously passed to GUI-A.
···
On Sunday, October 26, 2014 12:19:13 PM UTC-7, pluto mars wrote:
HI thanks,
I understand how I can achieved this with a custom dialog. BUt lets say I have on the custom dialog a bitmap displayed. And next to the bitmap a texctrl box and some other buttons. But now instead of having the bitmap + all other controls to be in a single dialog, I would like the bitmap and its zoom control slider in a separate dialog, and then all other controls in another dialog, but they would act as if they are on one dialog ?.
So, in principal, instead of one big dialog with all controls, I want multiple dialogs but the controls acting as if they are on one dialog. I want also only one close button, which if you click on it, all dialogs will close.