• 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
Keyboard input for NSStatusItems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Sending boolean value via XML-RPC using WebServicesCore.framework
  • Next by Date: Re: [NEWBIE QUESTION] What message is sent when window contents finish loading?
  • Previous by thread: Re: Sending boolean value via XML-RPC using WebServicesCore.framework
  • Next by thread: Displaying Current Time using Cocoa
  • Index(es):
    • Date
    • Thread