Can't get frame to be "modal" (if that's the word)

Hello all.

I’m trying to get one frame to open another frame, but when that happens I want the calling frame to “fall back” to the background and wait until the called frame has been closed.

To see the effect I’m looking for, just launch the wxPython demo. When the “Tip of the Day” window comes up, it won’t let you click anywhere outside it (well, you can click) but the “Tip of the Day” remains in the foreground until you close it. Also, try the “DirDialog” demo: once the directory selection window comes up, everything else falls back to the background until you’ve exited from the directory selection process.

In the script I’m attaching, the Main Frame opens with a panel and a button. Click the button, the Second Frame opens. But if you click on the Main Frame, then IT comes back to the foreground. Because I’m using self.Centre() for both frames, the smaller frame gets obscured and can only be acessed from the taskbar (on Windows).

I’ve tried .MakeModal() and tried calling the second frame using something like dlg=className.MakeModal().

With my thanks in advance, can someone tell me what am I doing wrong?

Two Classes_01.py (1.35 KB)

What platform, version are you using? Because on WindowsXP w/
2.8.10.1, it does work for me, that is, I cannot bring the main frame
to the front until I close the 2nd frame. My Linux install is not
working right now, so I can't test it on Linux.

Che

···

On Wed, Jun 30, 2010 at 5:02 PM, Sammer Shuli <sammer.shuli@gmail.com> wrote:

Hello all.

I'm trying to get one frame to open another frame, but when that happens I
want the calling frame to "fall back" to the background and wait until the
called frame has been closed.

To see the effect I'm looking for, just launch the wxPython demo. When the
"Tip of the Day" window comes up, it won't let you click anywhere outside it
(well, you _can_ click) but the "Tip of the Day" remains in the foreground
until you close it. Also, try the "DirDialog" demo: once the directory
selection window comes up, everything else falls back to the background
until you've exited from the directory selection process.

In the script I'm attaching, the Main Frame opens with a panel and a button.
Click the button, the Second Frame opens. But if you click on the Main
Frame, then IT comes back to the foreground. Because I'm using self.Centre()
for both frames, the smaller frame gets obscured and can only be acessed
from the taskbar (on Windows).

I've tried .MakeModal() and tried calling the second frame using something
like dlg=className.MakeModal().

With my thanks in advance, can someone tell me what am I doing wrong?

Thanks for the tip, Che.

I have a little utility called Filebox eXtender running, and it seems
to be blocking the MakeModal functionality on my script. Why it isn't
doing the same for the demo, I have no idea.

Turning off the utility makes the script run fine.

I'm on Windows XP with wxPython 2.8.11.0. Thanks again.

Sammer

···

On Jul 1, 1:50 am, C M <cmpyt...@gmail.com> wrote:

On Wed, Jun 30, 2010 at 5:02 PM, Sammer Shuli <sammer.sh...@gmail.com> wrote:

> Hello all.

> I'm trying to get one frame to open another frame, but when that happens I
> want the calling frame to "fall back" to the background and wait until the
> called frame has been closed.

> To see the effect I'm looking for, just launch the wxPython demo. When the
> "Tip of the Day" window comes up, it won't let you click anywhere outside it
> (well, you _can_ click) but the "Tip of the Day" remains in the foreground
> until you close it. Also, try the "DirDialog" demo: once the directory
> selection window comes up, everything else falls back to the background
> until you've exited from the directory selection process.

> In the script I'm attaching, the Main Frame opens with a panel and a button.
> Click the button, the Second Frame opens. But if you click on the Main
> Frame, then IT comes back to the foreground. Because I'm using self.Centre()
> for both frames, the smaller frame gets obscured and can only be acessed
> from the taskbar (on Windows).

> I've tried .MakeModal() and tried calling the second frame using something
> like dlg=className.MakeModal().

> With my thanks in advance, can someone tell me what am I doing wrong?

What platform, version are you using? Because on WindowsXP w/
2.8.10.1, it does work for me, that is, I cannot bring the main frame
to the front until I close the 2nd frame. My Linux install is not
working right now, so I can't test it on Linux.

Che