• 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: Jens Alfke <email@hidden>
  • Date: Fri, 18 Apr 2008 18:04:05 -0700


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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Modal popup from command line tool or daemon?
      • From: Rod Cater <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>)

  • Prev by Date: Re: Hand style movement inside a NSScrollView
  • Next by Date: Re: editing in a custom NSView
  • Previous by thread: Re: Modal popup from command line tool or daemon?
  • Next by thread: Re: Modal popup from command line tool or daemon?
  • Index(es):
    • Date
    • Thread