Keyboard input for NSStatusItems
Keyboard input for NSStatusItems
- Subject: Keyboard input for NSStatusItems
- From: Ricci Adams <email@hidden>
- Date: Sat, 28 Sep 2002 16:14:21 -0500
Hello everyone,
I am trying to get my NSStatusItem to accept keyboard input (it can
handle mouse events just fine). I tried setting a custom view to it
using setView:, however, this does not work.
I eventually found out that all NSStatusItem views are put into an
NSStatusBarWindow located off screen, which has a styleMask of 0
(NSBorderlessWindowMask). NSBorderlessWindowMask windows cannot become
key, therefore, they cannot accept keyboard input.
My second attempt was trying to create my own window and then position
it over the area in the status bar I wanted (bypassing NSStatusItem
altogether). Unfortunately, this does not work because I cannot get it
to automatically position over the correct area of the menu bar that I
want.
So, basically, if anyone could kindly answer one of these two
questions, I would be able to figure out the rest:
1) Is there any way to force a NSBorderlessWindowMask window to become
key.
2) Is there any way to get the global screen coordinates of a specific
NSView. (This way I could temporarily create an NSStatusItem, set a
temp view, get the screen coordinates of the temp view and then move my
actual window to the correct screen coordinates).
Also, if anybody has any solutions that I haven't thought of yet,
please inform me!
Thank you for your time!
Ricci Adams
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.