• 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
tracking mouse state outside of a view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tracking mouse state outside of a view


  • Subject: tracking mouse state outside of a view
  • From: Rob Ross <email@hidden>
  • Date: Tue, 17 Oct 2006 13:21:37 -0700

I'm implementing a custom NSView to use as the view of a NSStatusItem.

The custom view can hold an image and/or a title, just like the standard NSStatusItem does.

I can detect left/right mouse-down/up clicks in this NSView. When I detect a mouse down in my custom view, I set the state such that when I draw the custom view, I can draw it with the highlight background color and change the foreground text to white, to emulate what the standard NSStatusItem does.

However, I don't know how to get notified when the mouse is clicked elsewhere. In a normal NSStatusItem, if it's displaying a menu, when the user clicks the mouse anywhere else, such as in a Window or menu, etc, the menu displayed for the NSStatusItem is dismissed, and the highlighting goes back to normal.

Right now, the only way I can detect this end-of-menu tracking is when I click back in my custom view, but obviously this isn't going to help me.

So how do I find out if the mouse gets clicked elsewhere when I'm in the "drawing highlight" state, so I can go back to "drawing unhighlighted" state.

Thanks,


Rob Ross, Lead Software Engineer
E! Networks
---------------------------------------------------
"Beware of he who would deny you access to information, for in his heart he dreams himself your master." -- Commissioner Pravin Lal



_______________________________________________ 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: tracking mouse state outside of a view
      • From: Uli Kusterer <email@hidden>
  • Prev by Date: Re: get iTunes songs
  • Next by Date: How to capture Key event in a NSApp?
  • Previous by thread: Re: Problems with flipping an NSImage
  • Next by thread: Re: tracking mouse state outside of a view
  • Index(es):
    • Date
    • Thread