Re: why NSTrackingArea doesn't work?
Re: why NSTrackingArea doesn't work?
- Subject: Re: why NSTrackingArea doesn't work?
- From: Ken Thomases <email@hidden>
- Date: Wed, 22 Jun 2011 20:07:40 -0500
On Jun 22, 2011, at 7:41 PM, Conrad Shultz wrote:
> On 6/22/11 5:04 PM, Nick wrote:
>> NSTrackingArea* trackingArea = [[NSTrackingArea alloc] initWithRect:[self
>> frame] options: (NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways)
>> owner:self userInfo:nil];
>
> Don't use [self frame]... that is in the superview's coordinate system,
> not the tracking area's view's coordinate space (which is expected).
>
> Use [self bounds] instead; depending on the absolute position of your
> view this might make a HUGE difference.
I strongly recommend considering use of NSTrackingInVisibleRect, too. If your view changes windows or moves within its window, this will make things a lot simpler. It can be the wrong thing in rare cases, but I'd be surprised if you need one of those.
Regards,
Ken
_______________________________________________
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