Re: How can I display a pop-up alert message to a user from a background launchd daemon?
Re: How can I display a pop-up alert message to a user from a background launchd daemon?
- Subject: Re: How can I display a pop-up alert message to a user from a background launchd daemon?
- From: Nick Zitzmann <email@hidden>
- Date: Wed, 4 Feb 2009 12:07:19 -0700
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 (email@hidden)
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:
This email sent to email@hidden