Can NSTrackingArea rects be nested?
Can NSTrackingArea rects be nested?
- Subject: Can NSTrackingArea rects be nested?
- From: Stuart Malin <email@hidden>
- Date: Fri, 27 Mar 2009 12:48:28 -1000
I have a view that contains an NSTextView. I place NSTrackingAreas on
portions of the TextView's text. I attach a userInfo dictionary to
each of the tracking areas with a variety of parameters. The view
containing the TextView happens also to have an NSTrackingArea around
its entire frame. The NSTrackingAreaOptions are set to report mouse
entered/exited for all of these tracking areas.
When the mouse enters the outer (containing) view, *all* of the
tracking areas report the event, even though the mouse has not entered
any of the nested tracking areas. I thought perhaps I needed to do hit
testing of the mouse's hit point to see if it was in the tracking
area's rect. But this doesn't work, because the event's tracking area
as reported by [[event trackingArea] rect] is, in all cases, the rect
of the containing view. However, if I examine the content of the
event's userData, it is associated with the distinct smaller,
contained (nested) tracking areas.
I can't find much about this in the archives; I have read Quincey
Morris's "The NSTrackingArea Report" but have not ferreted anything
from it that sheds light on the situation I amencountering. Can
NSTrackingArea support nested tracking areas? Des anything special
need to be done?
_______________________________________________
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