• 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: NSCursor - ignore previous (was incomplete)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCursor - ignore previous (was incomplete)


  • Subject: Re: NSCursor - ignore previous (was incomplete)
  • From: Graham Cox <email@hidden>
  • Date: Mon, 23 May 2011 09:43:23 +1000

On 23/05/2011, at 3:26 AM, Adam Gerson wrote:

> I am not sure exactly where this code belongs or how to keep the
> cursor set this way. When I begin my animation I set the cursor, but
> it very quickly goes back to the "arrow". I believe this is happening
> when some of my views are getting redrawn with setNeedsDisplay which
> is part of what is happening in the background. Is there any way to
> get a custom cursor to stay set even if the view is redrawn and stay
> set until I manually set it back?


Setting the cursor should never be part of a view's drawing behaviour. If it is, then you will find managing it very difficult, if not impossible. If you've been doing that, you need to change it, but you can be sure that no views you didn't write are setting the cursor when drawing.

Cursors can be tricky, for sure. They are typically associated with an area of the screen - the cursor is set on entry to that area. This area might be a view or part of a view and the easiest and most reliable mechanism for getting notified when the cursor enters and leaves a given area is to use NSTrackingArea.

--Graham

_______________________________________________

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: NSCursor - ignore previous (was incomplete)
      • From: Andy Lee <email@hidden>
References: 
 >NSCursor - ignore previous (was incomplete) (From: Adam Gerson <email@hidden>)

  • Prev by Date: Re: How to start a Dashboard widget as soon as the user logs in?
  • Next by Date: Re: NSCursor - ignore previous (was incomplete)
  • Previous by thread: NSCursor - ignore previous (was incomplete)
  • Next by thread: Re: NSCursor - ignore previous (was incomplete)
  • Index(es):
    • Date
    • Thread