• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Modal popup from command line tool or daemon?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modal popup from command line tool or daemon?


  • Subject: Re: Modal popup from command line tool or daemon?
  • From: Rod Cater <email@hidden>
  • Date: Sat, 19 Apr 2008 00:43:07 -0400

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

_______________________________________________

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


References: 
 >Modal popup from command line tool or daemon? (From: Rod Cater <email@hidden>)
 >Re: Modal popup from command line tool or daemon? (From: "David Wilson" <email@hidden>)
 >Re: Modal popup from command line tool or daemon? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Hand style movement inside a NSScrollView
  • Next by Date: Re: Hand style movement inside a NSScrollView
  • Previous by thread: Re: Modal popup from command line tool or daemon?
  • Next by thread: Getting an array/tree controller to select newly added managed objects
  • Index(es):
    • Date
    • Thread