Re: NSTrackingArea mouse events
Re: NSTrackingArea mouse events
- Subject: Re: NSTrackingArea mouse events
- From: Quincey Morris <email@hidden>
- Date: Wed, 23 Dec 2009 16:15:37 -0800
On Dec 23, 2009, at 15:03, PCWiz wrote:
> 1. Does NSTrackingArea support mouseDown events? If so, how would I find if the click is within the bounds of a tracking rect in my mouseDown handler?
No. At the time you receive the mouseDown it's assumed you already know which tracking area(s) you're in, since you'll have already received NSMouseEntered events for any tracking areas the mouse has entered.
It seems feasible to find the tracking area by hit testing all of them serially, if you don't have the tracking status available and if there aren't a lot of tracking areas. However, that more or less wastes the tracking functionality, so it wouldn't be the preferred approach.
> 2. For mouseEntered and mouseExited handlers, how would I find which tracking rect the event occurred in (if there are multiple tracking rects)?
Use NSEvent's "trackingArea" property.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden