Martin Wierschin <[email protected]> wrote: > > I have a custom NSTextAttachmentCell that does its work by adding > > subviews to the NSTextView (e.g. NSButtons). This works fine. > > > > What I can't get to work is cursor handling; I always get an arrow > > cursor when the mouse is over my views. I overwrite resetCursorRects, > > like this: > ... > > This doesn't help. Getting desperate, I tried implementing > > mouseMoved:, but it's not even called > > Overriding mouseMoved is unfortunately required if you want to > customize the mouse cursor in NSTextView (see this post by the helpful > Mr Davidson).
What I missed was that in order to receive mouseMoved events, you need to set a tracking area first; I had assumed that mouseMoved: is automatically called for the deepest view under the mouse that implements it. (Reading the docs can help at times...) After overriding updateTrackingAreas in my subview and installing a suitable NSTrackingArea, things work in most situations; I then still had to override mouseMoved: in the NSTextView though, and keep it from calling super if the subview had set the cursor, otherwise the cursor would still be reset to an arrow in certain cases. Thanks for the help (also to Douglas, who sent me private mail). -Stefan -- Stefan Haller Berlin, Germany http://www.haller-berlin.de/ _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
