Re: trackingAreas can be snuck up on without triggering?
Re: trackingAreas can be snuck up on without triggering?
- Subject: Re: trackingAreas can be snuck up on without triggering?
- From: "email@hidden" <email@hidden>
- Date: Sun, 20 May 2012 02:21:46 -0700
No, the window is very vanilla. No scrollviews. Hierarchy is
NSWindow
NSView (window's content view)
MyView
Your alternate approach is essentially to give up on tracking areas, no? The tracking area approach has an attractive simplicity, especially once my view hierarchy and cursor tracking needs get more complicated, but if it's broken, I guess I'll have to roll my own solution. And file a bug report.
I should have mentioned that this is on 10.7.4. Won't be able to test on 10.6.8 until Monday. Hi Alex!
_murat
On May 19, 2012, at 10:29 PM, Quincey Morris wrote:
> On May 19, 2012, at 22:10 , email@hidden 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 (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