Re: NSCursor tracking areas
Re: NSCursor tracking areas
- Subject: Re: NSCursor tracking areas
- From: Cody Garvin <email@hidden>
- Date: Thu, 24 Jul 2014 06:37:59 -0700
Tried to send this yesterday with code, but I guess it was too big.
This is on Xcode 6 Beta 4 / OS X 10.10. The app is built for 10.10, so perhaps a bug.
I’m getting some randomness with updating the cursor. Sometimes works as intended, sometimes not.
I have four hotspots on the corners of selected objects that can be resized. In these 4 areas the cursor is supposed to change to a “draggable cursor”, and reset when it exits that area. As well, the entire object is draggable, so I wanted an open hand cursor to indicate that when over the main objects.
It seems NSCursor and the way it works has changed over the years. Perhaps my methods are out of date.
I use updateTrackingAreas to remove all the tracking areas, then adding new ones (same rects as the drag points) with the options: NSTrackingActiveInActiveApp | NSTrackingCursorUpdate | NSTrackingAssumeInside
I then use cusrorUpdate:(NSEvent *)theEvent to change the cursor by iterating over theEvent’s converted point to the view and matching it with a drag point (I do this because in the future the object itself will use another cursor for dragging it around. Then use [[NSCursor pointingHandCursor] set].
Is this not the preferred way? Is overlapping the main area with the drag areas causing issues?
Thanks
- Cody
_______________________________________________
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