• 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: NSStatus item from background / command line application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSStatus item from background / command line application


  • Subject: Re: NSStatus item from background / command line application
  • From: Rosyna <email@hidden>
  • Date: Tue, 21 Nov 2006 16:45:06 -0700

Ack, at 11/21/06, Alexander Hartner said:

I am working on a command line application. During the execution I would like to provide some user feedback, similar to what growl offers. I though of using a NSStatusItem as follows:

NSStatusBar * bar = [NSStatusBar systemStatusBar];
NSStatusItem * theItem = [bar statusItemWithLength:NSVariableStatusItemLength];
[theItem retain];
...


When I execute my "Tool" application the NSStatusItem is not show and a error message is printed.

_NXCreateWindow: error setting window property (1002)
PSsetwindowlevel, error setting window level (1002)

Try calling:

ProcessSerialNumber psn;
OSStatus err=GetCurrentProcess(&psn);

First. That will initiate a connection to the window server. However, this also means that the tool will quit when the user logs out and the uid of the tool must be the same as the logged in user. Otherwise, you can create a new subtool that you launch with Launch Services or NSWorkspace (which uses Launch Services).

I am guessing this is not allows to create a NSStatusItem from a tool. Yet the iSync NSStatusItem seems to be able to do this. Are these kind of menus done using MenuExtras?

Correct, the iSync item is a menu extra. Menu Extras are subviews of one larger NSStatusItem that the SystemUIServer owns.
--



Sincerely, Rosyna Keller Technical Support/Carbon troll/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People

It's either this, or imagining Phil Schiller in a thong.
_______________________________________________

Cocoa-dev mailing list      (email@hidden)

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: 
 >NSStatus item from background / command line application (From: Alexander Hartner <email@hidden>)

  • Prev by Date: afp_mount
  • Next by Date: Re: External kill of an NSThread?
  • Previous by thread: NSStatus item from background / command line application
  • Next by thread: afp_mount
  • Index(es):
    • Date
    • Thread