Skip navigation.
 
mlRe: Modal popup from command line tool or daemon?
FROM : Rod Cater
DATE : Sat Apr 19 06:43:07 2008

I think the CFUserNotification API is exactly what I'm looking for, 
although I'm not pleased with daemons requiring user interaction in 
the first place. An earlier reply suggested Growl which I'm thinking 
is better suited for what I'm doing. Combined with a simple 
preference pane for setting configuration and a CFUserNotification 
object for alerts, this should keep user interactions to a minimum.

Thanks for the responses!

Rod

On 18-Apr-08, at 9:04 PM, Jens Alfke wrote:

>
> On 18 Apr '08, at 1:21 PM, David Wilson wrote:
>

>> A command line tool or a true background daemon can't really pull it
>> off- the process wouldn't have a connection to the window server to
>> actually do any of that.

>
> A command-line tool, invoked from a logged-in user account, can use 
> a GUI if it's linked against the appropriate libraries (like 
> AppKit). As a trivial example, you can launch a regular Cocoa app 
> from a shell by just running its binary directly.
>
> But this usually isn't a good idea for something that's primarily 
> meant as a daemon or tool. A better way to do simple alert-style 
> interaction is to use the API in CFUserNotification.h. This doesn't 
> require you to link against anything higher-level than 
> CoreFoundation. The downside is that it's kind of messy to use for 
> anything beyond a simple "message and OK button" alert; but I think 
> there is sample code with examples.
>
> —Jens

Related mailsAuthorDate
mlModal popup from command line tool or daemon? Rod Cater Apr 18, 21:49
mlRe: Modal popup from command line tool or daemon? David Wilson Apr 18, 22:21
mlRe: Modal popup from command line tool or daemon? Daniel Staal Apr 18, 22:31
mlRe: Modal popup from command line tool or daemon? Jens Alfke Apr 19, 03:04
mlRe: Modal popup from command line tool or daemon? Rod Cater Apr 19, 06:43