On Feb 4, 2009, at 11:49 AM, Tom Fortmann wrote:

Can anyone offer some guidance on how to pop-up a dialog box from a
background process? I have a system daemon started by launchd out of the /Library/LaunchDaemons folder. Among other things the daemon manages a
background software update process, and depending on the extent of the
change requires the user to restart the system. It is currently written in C++ and for the most part only uses POSIX API's with a very small number of CoreServices and CoreFoundation functions. Can anyone offer some advice on
the best way to approach this?


You're going to need to write a socket interface into your daemon. It can use either DO, or NSDistributedNotificationCenter, or Unix socket files, or something similar. Then you'll need to write an LSUIElement application that listens to that socket interface and does the actual GUI work based on messages received. I've done this before with a background daemon process, and although this sounds complicated, you pretty much have to do it this way, since background tasks not launched under your user's account generally can't make window server connections for security reasons.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to