On May 19, 2012, at 22:10 , mlist0...@gmail.com wrote:

> If I whip the mouse into the window's content area, my cursorUpdate method is 
> called and I see the correct cursor. If I slowly sneak the mouse into my 
> window's content area, I see the window resize cursor for a moment as I cross 
> into the window content area (I'm running Lion), then... nothing. The cursor 
> reverts to the arrow cursor, and my cursorUpdate: method is not called, even 
> though I am well into my view's rectangle.

Does the window contain a NSScrollView? If so, there are certain places/timings 
where the scroll view takes control of the cursor. IIRC, the easiest workaround 
is to set scrollView.documentCursor to the same cursor you set for your view in 
'cursorUpdate:' -- though I haven't tested the effects of this in Lion.

Another [or a complementary] approach is to invoke 'cursorUpdate:' like this:

- (void) mouseMoved: (NSEvent*) event {
        [self cursorUpdate: event];
        … other code for this method, if you have it …
}

It doesn't hurt to do the same in 'mouseDown:', 'mouseUp:', 'mouseDragged:', 
'mouseEntered:' and 'mouseExited:', if you use any of those. This saves a lot 
of puzzling over other "missing" cursor updates, and it often simplifies your 
code by centralizing cursor setting.


_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to