Re: Finding NSStatusItem's global coordinates/location
Re: Finding NSStatusItem's global coordinates/location
- Subject: Re: Finding NSStatusItem's global coordinates/location
- From: Rakka <email@hidden>
- Date: Mon, 19 Dec 2005 18:48:21 +1100
Thanks for the reply :) I appreciate it, works nicely.
I have another problem as well.
I want the borderless window to show up when I click the statusItem.
For example, if I have a statusitem with a custom view, how am I
supposed to make it look as if it has been highlighted when clicked,
unhighlight and close the borderless when the mouse goes away, and all
the other behaviour of a regular statusItem? Really confusing me :P
Thanks.
I know I have to do all the mousedown things, etc. but are there any
examples I could have in making it act like a regular statusitem but
just with a borderless window instead of a menu?
On 12/19/05, Daniel Jalkut <email@hidden> wrote:
>
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