[PYTHONMAC-SIG] faceless background applet?

Joseph Strout jstrout@ucsd.edu
Tue, 8 Oct 1996 17:16:33 -0700 (PDT)


Ages ago, I wrote...

> > Would anyone happen to know how I could make a Python applet faceless --
> > that is, run in the background, and not callable to the front?  (I want to
> > make a background server that casual users can't easily quit.)

And Jack and I tried it, and it reliably crashed.

Well, there's a new technote on background-only apps at:
	http://devworld.apple.com/dev/technotes/tn/tn1070.html

...the key things that I can see are:

(1) The app must not call InitWindows(), InitMenus(), or any toolbox
	function that might draw on the screen

(2) The app gets a stack size of only 2K, and must expand this itself
	if it will need more (which surely we would!).

It doesn't seem like it would be too hard to comply with these... ideally,
the MacPython main program would check its backgroundOnly bit, and if set,
comply with the above requirements.  (In addition, it is vital that the
app respond to a Quit AppleEvent; otherwise, the Mac will refuse to shut
down or restart.)  This would be a very handy capability, allowing us to
write faceless daemons in Python.

,------------------------------------------------------------------.
|    Joseph J. Strout           Department of Neuroscience, UCSD   |
|    jstrout@ucsd.edu           http://www-acs.ucsd.edu/~jstrout/  |
`------------------------------------------------------------------'


=================
PYTHONMAC-SIG  - SIG on Python for the Apple Macintosh

send messages to: pythonmac-sig@python.org
administrivia to: pythonmac-sig-request@python.org
=================