• 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: Finding NSStatusItem's global coordinates/location
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding NSStatusItem's global coordinates/location


  • Subject: Re: Finding NSStatusItem's global coordinates/location
  • From: Daniel Jalkut <email@hidden>
  • Date: Sun, 18 Dec 2005 12:31:01 -0500

Hi Rakka - what I do in FastScripts to find the position of the status item is to examine the frame of the status item's window (yes, there's a teeny-tiny window associated with each status item).

For instance:

NSRect myStatusItemFrame = [[[myStatusItem view] window] frame];

It took me a while to figure this out, too. Hope this is what you're looking for!

There is a slight chance Apple could change the implementation of status items in the future such that this would stop working as expected. But since an NSView has to be embedded in a window in order to be visible, I expect they'll always have a window up there. And since the window is in the "scope of your app" I doubt they'll ever change it to be any bigger than it needs to be to contain your item.

Daniel

On Dec 17, 2005, at 8:45 PM, Rakka wrote:

Really lost at the moment :)

I have decided to use a borderless window instead of a window, but now
I can't seem to find the NSStatusItems position through any methods...
I must be overlooking something really simple. Any ideas?

Thanks a lot.

Btw, the status item doesn't have a custom view, and has an action to
display the window.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com

This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Finding NSStatusItem's global coordinates/location
      • From: Rakka <email@hidden>
References: 
 >Finding NSStatusItem's global coordinates/location (From: Rakka <email@hidden>)

  • Prev by Date: Re: Using Zip executable in Cocoa Application
  • Next by Date: Re: Exporting to Grapher
  • Previous by thread: Finding NSStatusItem's global coordinates/location
  • Next by thread: Re: Finding NSStatusItem's global coordinates/location
  • Index(es):
    • Date
    • Thread