• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: trackingAreas can be snuck up on without triggering?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trackingAreas can be snuck up on without triggering?


  • Subject: Re: trackingAreas can be snuck up on without triggering?
  • From: Quincey Morris <email@hidden>
  • Date: Sat, 19 May 2012 22:29:13 -0700

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


  • Follow-Ups:
    • Re: trackingAreas can be snuck up on without triggering?
      • From: "email@hidden" <email@hidden>
References: 
 >trackingAreas can be snuck up on without triggering? (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: trackingAreas can be snuck up on without triggering?
  • Next by Date: Re: trackingAreas can be snuck up on without triggering?
  • Previous by thread: Re: trackingAreas can be snuck up on without triggering?
  • Next by thread: Re: trackingAreas can be snuck up on without triggering?
  • Index(es):
    • Date
    • Thread