NSTrackingArea + cursorUpdate: problem
NSTrackingArea + cursorUpdate: problem
- Subject: NSTrackingArea + cursorUpdate: problem
- From: Raphael Sebbe@Google <email@hidden>
- Date: Wed, 28 Nov 2007 22:41:52 +0100
Hi,
I am trying to use the new cursor handling mecanism of Leopard.
My view has some regions (rects) inside of it where the cursor should
be changed, otherwise should be a regular arrow.
1. From the doc, it is unclear to me if NSTrackingCursorUpdate can be
used or not in that case (rect != bounds). At least what I get is the
cursorUpdate: method being invoked both when entering AND leaving the
area. Which means the cursor never becomes an arrow again inside that
view.
How should this be handled ?
2. Also the doc states that NSTrackingArea can overlap in different
views. What about overlapping in the same view ?
Here is the code
----
trackingArea = [[NSTrackingArea alloc] initWithRect:[self
thresholdRect:i]
options: (NSTrackingCursorUpdate |
NSTrackingActiveInActiveApp)
owner:self userInfo:nil];
[self addTrackingArea:trackingArea];
-(void)cursorUpdate:(NSEvent *)theEvent
{
NSLog(@"event : %@", theEvent);
[[NSCursor crosshairCursor] set];
}
Thanks,
Raphael
_______________________________________________
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