Re: Cocoa daemon
Re: Cocoa daemon
- Subject: Re: Cocoa daemon
- From: Christopher Corbell <email@hidden>
- Date: Wed, 12 Nov 2003 21:38:16 -0800
On Nov 12, 2003, at 8:27 PM, Phillip Hutchings wrote:
On 13/11/2003, at 1:17 PM, Kris Kopicki wrote:
Hi,
I've written a simple Cocoa app that basically listens for
NSWorkspaceWillLaunchApplicationNotification's. Is there anyway to
make such an application a daemon? NSWorkspace seems dependent on
NSApplication, and to my knowledge the only way to do a cocoa daemon
is using daemon() and NSRunLoop. I'm sure it can probably be done
using carbon, but I'm trying to avoid carbon as I'm not all that
familiar with it.
Cheers,
Kris
You could set the NSUIElement flag in the apps info.plist, this will
prevent the dock from showing the icon.
Just add this at the end of the file:
<key>NSUIElement</key>
<string>1</string>
--
Phillip Hutchings
[....]
I have a couple of follow-up questions:
1) Is it possible for an app to change state in this regard?
E.g. could a regular Cocoa app with icon in the dock be switched
into daemon mode, so that its main process keeps running but its
UI and dock icon go away?
2) If the app is created as a daemon but contains AppKit,
can it still (say, responding to an AppleEvent) come to the
foreground, put up a menu bar & UI, etc?
Thanks for any testimonials, this behavior is really intriguing...
- Christopher
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.