Can't close a Frame whose parent is a modal Dialog

Hello, I have exactly the same problem as already discussed at
http://wxpython-users.1045709.n5.nabble.com/can-t-close-frame-via-wx-EVT-CLOSE-td2366090.html

I have a main application frame, a modal wx.Dialog from which I need
to open
another wx.Frame (I'll call it a popup frame) and be able to switch
between
the dialog and the popup frame, without being able to get back to the
main
application frame (as the dialog is modal). The close button on the
popup
frame doesn't work as long as the dialog is open. When I close the
dialog,
it is also possible to close the popup frame. I need to be able to
close
the popup frame using the 'x' button while the dialog is still open.

wx 2.8.1 on Linux/GTK

I can't turn the parent dialog into a wx.Frame. Using None as a
parent of
the popup frame doesn't help. Is there any known work around? Thanks

TC wrote:

Hello, I have exactly the same problem as already discussed at
http://wxpython-users.1045709.n5.nabble.com/can-t-close-frame-via-wx-EVT-CLOSE-td2366090.html

I have a main application frame, a modal wx.Dialog from which I need to open another wx.Frame (I'll call it a popup frame) and be able to switch between the dialog and the popup frame, without being able to get back to the main application frame (as the dialog is modal). The close button on the popup frame doesn't work as long as the dialog is open. When I close the dialog, it is also possible to close the popup frame. I need to be able to close the popup frame using the 'x' button while the dialog is still open.

wx 2.8.1 on Linux/GTK

I can't turn the parent dialog into a wx.Frame. Using None as a parent of the popup frame doesn't help. Is there any known work around?

Is the behavior different if you make the child frame into a non-modal
wx.Dialog instead?

Modal dialogs have special behaviors and don't always play well with
others. Could you, perhaps, consider a different design, where instead
of a popup frame, you place the contents inside a wx.Panel, and then
extend your dialog window to contain the panel? So, the dialog could
have a "More>>" button that grows the window and shows the extra stuff.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Is the behavior different if you make the child frame into a non-modal
wx.Dialog instead?

Unfortunately not. I also tried various other combinations, such as
using different parents for the dialog and the popup frame as well
with no success. The only working setup is when I use a modal Dialog
instead of a non modal frame (so there are two modal dialogs and
parents are as: app frame -> dialog1 -> dialog2). This is however not
practical for my needs.

Modal dialogs have special behaviors and don't always play well with
others. Could you, perhaps, consider a different design, where instead
of a popup frame, you place the contents inside a wx.Panel, and then
extend your dialog window to contain the panel? So, the dialog could
have a "More>>" button that grows the window and shows the extra stuff.

Yes, that's probably the best way to get around. In fact it may be
even more user friendly than with separate frames. Thanks for the
tip.

Best regards, Tomas

···

On Jun 7, 1:21 am, Tim Roberts <t...@probo.com> wrote: