[Pythonmac-SIG] GUI apps appearing behind other apps on startup

Jack Jansen Jack.Jansen@oratrix.com
Sun, 20 Apr 2003 23:26:35 +0200


On zondag, apr 20, 2003, at 20:39 Europe/Amsterdam, Kevin Altis wrote:

> I've brought this up before, but I don't remember if there was a 
> solution. I
> seem to remember Just saying that making a bundle solved the problem, 
> but I
> can't even find that email. Besides that is only a partial solution 
> since I
> don't want to have to build bundles while developing/testing an app.
>
> Anyway, using the 2.3a2 binary the Robin built and wxPython 2.4.0.7,
> double-clicking a GUI script (uses PythonLauncher) or starting it with
> pythonw in the Terminal causes the app to appear behind other windows 
> on the
> desktop.

The problem isn't specific to Python: *any* program launched from the 
Terminal
window will start behind the terminal.

My guess is that the problem is probably unsolvable[*] for calling 
pythonw
from the Terminal window, but that it may be solvable for 
PythonLauncher, by
switching to Launch Services to start pythonw. As Apple always states 
that
there is no magic in the Finder any more but all the magic is in Launch
Services that may do the trick. But the problem then is finding out how
to pass all the right options. Feel free to post a bug report, adding
working code will speed it up immensely:-)

[*] I think there is a solution for pythonw too, by using the 
undocumented
and unsupported CPS calls. I want to stay away from them, however, as 
they
are not part of the official API, and the Tcl/Tk folks were explicitly
warned to not use them.
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -