Re: Cocoa daemon
Re: Cocoa daemon
- Subject: Re: Cocoa daemon
- From: Phillip Hutchings <email@hidden>
- Date: Thu, 13 Nov 2003 20:08:14 +1300
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?
Not in one launch. This behaviour is controlled by the Window Server,
and hence is read at launch time. You can manipulate the info.plist
file to add/remove the tag.
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...
Only if running with the NSUIElement in the login session (I think
that's what apple calls it) instead of the root session. The
application can display windows and things like NSStatusItems, but not
a menu bar in my experience. To display a UI the app has to bind to a
users' window server, hence no system daemon can create a UI, nor can
it use AppKit. I believe such an application can use Foundation
classes, and thus respond to AppleEvents, but don't quote me on this.
Your best bet with an application that has to run at startup is to use
messaging to control the daemon from a user application
--
Phillip Hutchings
email@hidden
http://www.sitharus.com/
_______________________________________________
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.