Open a modal dialog with various configuration options (i.e. widgets)
Buttons on the dialog open a separate frame with a graphical representation of the current data
Capture keyboard/mouse events in the graphics frame, and apply changes to the appropriate widgets in the dialog
This works fine if done in exactly this order; the graphics frame becomes the top window when launched. If I click the dialog again, however, I’m stuck there permanently. If the graphics window is already open, I can’t access it via the dialog - I have a reference to it, but Show() and SetFocus() don’t do anything. I’d like it to be possible to leave it open continuously, and activate it as needed. Is there any way to do this? I even tried Close() and then Show() on the frame while the dialog is open, and that didn’t work either. I’m confused why creating a new frame and calling Show() works, but what I’m doing doesn’t.
Alternately, if there’s a way to make a dialog temporarily become non-modal, or even have the option to open a dialog with or without modality (if that’s the right term), that would probably be enough. In the worst case, I assume I could close and destroy the frame entirely and restart it from scratch, but this is clumsy.
1) Open a modal dialog with various configuration options (i.e. widgets)
2) Buttons on the dialog open a separate frame with a graphical representation of the current data
3) Capture keyboard/mouse events in the graphics frame, and apply changes to the appropriate widgets in the dialog
This works fine if done in exactly this order; the graphics frame becomes the top window when launched. If I click the dialog again, however, I'm stuck there permanently. If the graphics window is already open, I can't access it via the dialog - I have a reference to it, but Show() and SetFocus() don't do anything. I'd like it to be possible to leave it open continuously, and activate it as needed. Is there any way to do this? I even tried Close() and then Show() on the frame while the dialog is open, and that didn't work either. I'm confused why creating a new frame and calling Show() works, but what I'm doing doesn't.
Alternately, if there's a way to make a dialog temporarily become non-modal, or even have the option to open a dialog with or without modality (if that's the right term), that would probably be enough. In the worst case, I assume I could close and destroy the frame entirely and restart it from scratch, but this is clumsy.
You can't switch back and forth, but you can use Show() instead of ShowModal() if you don't want modality.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Actually, about ten minutes after I sent that message I discovered wx.Frame.Raise(), which does exactly what I needed - of course if I click on the dialog again it blocks all other frames, but I can always re-raise the graphics window by clicking the appropriate button in the dialog.
···
On Thu, Aug 14, 2008 at 12:39 PM, Robin Dunn robin@alldunn.com wrote:
Nathaniel Echols wrote:
I’m trying to do the following:
Open a modal dialog with various configuration options (i.e. widgets)
Buttons on the dialog open a separate frame with a graphical representation of the current data
Capture keyboard/mouse events in the graphics frame, and apply changes to the appropriate widgets in the dialog
This works fine if done in exactly this order; the graphics frame becomes the top window when launched. If I click the dialog again, however, I’m stuck there permanently. If the graphics window is already open, I can’t access it via the dialog - I have a reference to it, but Show() and SetFocus() don’t do anything. I’d like it to be possible to leave it open continuously, and activate it as needed. Is there any way to do this? I even tried Close() and then Show() on the frame while the dialog is open, and that didn’t work either. I’m confused why creating a new frame and calling Show() works, but what I’m doing doesn’t.
Alternately, if there’s a way to make a dialog temporarily become non-modal, or even have the option to open a dialog with or without modality (if that’s the right term), that would probably be enough. In the worst case, I assume I could close and destroy the frame entirely and restart it from scratch, but this is clumsy.
You can’t switch back and forth, but you can use Show() instead of ShowModal() if you don’t want modality.