nstableview in drawer resetting custom cursor
nstableview in drawer resetting custom cursor
- Subject: nstableview in drawer resetting custom cursor
- From: Nestor Cardozo <email@hidden>
- Date: Thu, 08 Apr 2010 09:27:43 +0200
I am adding objects to the content array of a NSArrayController by clicking in an NSView. When doing this, the mouse cursor is set to a cross-hair cursor.
The contents of the NSArrayController are displayed in a NSTableView in an NSDrawer (the columns of the NSTableView are bound to the contents of the NSArrayController).
So every time I click, a new row is added to the NSTableView in the NSDrawer.
This works fine. The problem is that when an object is added to the content array (a new row is added to the NSTableView), the mouse cursor is reset to the default arrow cursor. Even though, the cursor when the mouse is inside the NSView is set to a cross-hair cursor. Actually, when moving the mouse outside the NSView and back to the NSView the mouse cursor returns to the cross-hair cursor, which is how is supposed to be.
So there is something in the NSTableView or in the enveloping NSScrollView that is resetting the mouse. I have tried avoiding this behavior by disabling the cursor rects (disableCursorRects) before adding the object and enabling them (enableCursorRects) afterwards. But that does not work. The closest I got to a solution was by invalidating the cursor rectangles in the drawer, something like this:
[[theDrawer parentWindow] invalidateCursorRectsForView:[theDrawer contentView]];
But that, gives an erratic behavior. Sometimes the mouse is rest to the custom arrow, sometimes is not.
So, how do I stop the AppKit resetting the mouse cursor to the default?
Regards
Nestor Cardozo
_______________________________________________
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