Modal vs Standard Dialog

Hello,
I have a problem in understanding the behaviour of modal dialogs in a
complex application. My application need to open more than one frames and
manage them, mimic a SDI multi-window enviroment (I don't know of this is
the right description).
It happens that when a frame opens a modal dialog the whole application is
waiting for that dialog to close, in line with my knowledge.
But I found that if the dialog is a standard dialog, for example a file
dialog, only the parent frame is waiting for the dialog to close. The other
frames are all working.
I was considering having all the dialogs working in the same way and the
second one is preferable, i.e. with only the parent frame waiting. But I
tried different solution without success, including the use of the
WS_EX_BLOCK_EVENTS flag that in this situation has no effect (probably I
didn't understand well it's meaning).
    
I did a simple example that I attach to this mail. In this example two
frames are created: if you open from one frame the file dialog you can
continue working on the other, opening another file dialog for example or
creating a new frame. If you open the custom modal dialog from one frame the
other frame cannot be accessed with everybody waiting for this dialog to
close.
I use Windows 2K, python 2.54 and wx 2.8.10.1.
Any suggestion?
Thanks and regards,
Enrico

test-dlg.py (1.72 KB)

Hi,

···

On Dec 3, 3:10 am, ricer...@infinito.it wrote:

Hello,
I have a problem in understanding the behaviour of modal dialogs in a
complex application. My application need to open more than one frames and
manage them, mimic a SDI multi-window enviroment (I don't know of this is
the right description).
It happens that when a frame opens a modal dialog the whole application is
waiting for that dialog to close, in line with my knowledge.
But I found that if the dialog is a standard dialog, for example a file
dialog, only the parent frame is waiting for the dialog to close. The other
frames are all working.
I was considering having all the dialogs working in the same way and the
second one is preferable, i.e. with only the parent frame waiting. But I
tried different solution without success, including the use of the
WS_EX_BLOCK_EVENTS flag that in this situation has no effect (probably I
didn't understand well it's meaning).

I did a simple example that I attach to this mail. In this example two
frames are created: if you open from one frame the file dialog you can
continue working on the other, opening another file dialog for example or
creating a new frame. If you open the custom modal dialog from one frame the
other frame cannot be accessed with everybody waiting for this dialog to
close.
I use Windows 2K, python 2.54 and wx 2.8.10.1.
Any suggestion?
Thanks and regards,
Enrico

I think what you're looking for is Parent-Modal dialogs. Fortunately,
there's a recipe or two for just such a beast on the wiki:

http://wiki.wxpython.org/ParentModalDialog

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org