making a 2nd top level window appear in front of the 1st

hi,

macosx-10.4.11, python-2.6, wxpython-unicode-2.8.9.1

i have an application that occasionally creates temporary
top level windows. i've just added a new one and it is
consistently appearing behind the top level window that is
its "parent". all previous ones have consistently appeared
in front of the (same) "parent" top-level window.

i saw a post by robin that suggested calling Raise().
i did that immediately after Show() but it had no effect.

any other suggestions on how i can control it reliably? i
don't want to force it to stay in front of everything else,
just to appear where the user will see it.

maybe i should make it a dialog instead.

cheers,
raf

raf wrote:

hi,

macosx-10.4.11, python-2.6, wxpython-unicode-2.8.9.1

i have an application that occasionally creates temporary
top level windows. i've just added a new one and it is
consistently appearing behind the top level window that is
its "parent". all previous ones have consistently appeared
in front of the (same) "parent" top-level window.

i saw a post by robin that suggested calling Raise().
i did that immediately after Show() but it had no effect.

any other suggestions on how i can control it reliably? i
don't want to force it to stay in front of everything else,
just to appear where the user will see it.

maybe i should make it a dialog instead.

ah, the problem was that i was creating the window from
within an event handler for a popup menu.

once again, CallAfter() saves the day (by delaying
the window creation until after the popup has gone).

i really should just start doing everything via CallAfter :slight_smile:

cheers,
raf

raf wrote:

raf wrote:

hi,

macosx-10.4.11, python-2.6, wxpython-unicode-2.8.9.1

i have an application that occasionally creates temporary
top level windows. i've just added a new one and it is
consistently appearing behind the top level window that is
its "parent". all previous ones have consistently appeared
in front of the (same) "parent" top-level window.

i saw a post by robin that suggested calling Raise().
i did that immediately after Show() but it had no effect.

any other suggestions on how i can control it reliably? i
don't want to force it to stay in front of everything else,
just to appear where the user will see it.

maybe i should make it a dialog instead.
    
ah, the problem was that i was creating the window from
within an event handler for a popup menu.

once again, CallAfter() saves the day (by delaying
the window creation until after the popup has gone).

i really should just start doing everything via CallAfter :slight_smile:

cheers,
raf
  
I usually use a wx.Dialog instance with a call to its ShowModal() method for this sort of thing. Admittedly, I don't have a Mac, so there are probably some caveats that I am unaware of...

ยทยทยท

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

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org