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 (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to