[Pythonmac-SIG] (silly newbie question) Bringing a process to the front

Byron Formwalt ByronFormwalt@aaahawk.com
Mon, 12 Aug 2002 20:58:27 -0400


On 8/12/02 6:03 AM, "Richard Bornat" <richard@dcs.qmul.ac.uk> wrote:

> My problem with native Aqua and python seems to have a peculiar root.
> 
> What I see is that if I run the following command from Terminal
> 
> /Library/Frameworks/Python.framework//Versions/2.2/bin/python
> ~/cvsdownloads/jape/jape/X/python/GUI/japeserver.py
> 
> then I see a process window in the background, which won't come to the
> foreground.  If I click on the window, I get the message
> 
> SetFrontProcess failed,-600
> 
> (note, because of what follows, that the command is issued with absolute
> pathnames.
> 
> If I run a similar command from a Unix process (actually, by issuing the
> absolute path of japeserver.py, which starts with
> 
> #!/usr/bin/env python
> 
> ) then the process runs -- I can see its messages on the console -- but
> I can't see a window at all.
> 
> For this reason I downloaded the CVS source and (as my earlier message
> revealed) managed to build native Aqua, but failed to install it.
> 
> Then, at last, a clue.  Frustrated by python, I started to build an
> analogue in Java.  When I run this process with a local pathname I get
> the same behaviour as with the python version
> 
> ./japeserver
> [JavaAppLauncher Error] executable path must be an absolute path, or it
> cannot be brought to foreground
> Buckyball: Couldn't bring app to front, err=-600
> 
> (that is, a process which is clearly running in the background, but
> whose windows are invisible).  Running it with an absolute pathname
> works fine -- I get to see the window, I can interact with the menus.
> 
> I'd rather not spend a month or so transcribing the python code into
> Java (not yet, anyway).  So can anybody suggest what commands I should
> be issuing -- from shell and from Unix process -- to start a python
> which I _can_ interact with?
> 
> Richard Bornat
> 
> 
> 

Hi, Richard.  I just ran into the exact same problem.  Apparently you can't
launch a tkinter app from the command line.  You can, however launch a
wxWindows app from the command line, (MachoPython with wxMacPython) using
the pythonw script/link.  But there seem to be several problems with
wxWindows, still.  So, I'm trying to figure out how to get wxWindows working
with carbon MacPython in OS X, while the MachoPython version is being fixed.
I just started working with this about a week ago.  If you want to
collaborate in more detail offline from the group, just email me directly.

Byron