Re: Cursor updates - bug or programmer ignorance?
Re: Cursor updates - bug or programmer ignorance?
- Subject: Re: Cursor updates - bug or programmer ignorance?
- From: Luke Evans <email@hidden>
- Date: Wed, 21 Jan 2009 00:12:05 -0800
Thanks for the suggestion. You were spot on!
I changed the scroll view cursor to pointingHandCursor and guess what
appears after the short pause? Pity cocoa doesn't have a standard
icon of a smoking gun :-)
Right, well at least now I know the perpetrator! The next question is
of course what to do about it.
I looked in the NSScrollView, NSClipView and NSView documentation, and
I think "poorly documented" is a bit mild. I can see the methods on
NSScrollView and NSClipView, but haven't found anything that indicates
when the scroll view updates the cursor, how to stop it trying or how
to know that it has gone and messed with the cursor so I can 'repair
the damage'. Any suggestions for the fix?
I can probably have my code update the scroll view's idea of what the
cursor should be every time I assert it - but that seems extremely
awkward. I tried setting 'nil' as the cursor to see if I could bind
the little imp in NSScroller and prevent him from setting the cursor,
but apparently he interprets this as my desire to have an arrow cursor
forced on my table view every few seconds.
I'm hoping for a reasonable way to turn this off - otherwise is really
seems like a bug (to harken back to by original subject line).
Thanks again for the help so far. I can't imagine how long it would
have taken to finger NSScrollView as the culprit otherwise - that was
so outside the lines of enquiry I had drafted up to that point!
It's poorly documented, but a NSScrollView (or perhaps its
NSClipView) will sometimes reset the cursor, and your NSTableView is
of course embedded in a NSScrollView. However, I've only seen it
change the cursor like this when the mouse is down (e.g.
autoscrolling or interacting with the scroll bars).
There's also an easy experiment you can try. In your subclass
initialization, call [NSScrollView setDocumentCursor:] with an
easily recognizable cursor that you don't otherwise use. Then if
your problem is NSScrollView's fault, the cursor will switch to that
cursor instead of the arrow.
_______________________________________________
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