• 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
How to correctly control cursor???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to correctly control cursor???


  • Subject: How to correctly control cursor???
  • From: Scott Ribe <email@hidden>
  • Date: Sat, 09 Oct 2004 12:38:22 -0600

I'm implementing a custom control, and want it to change the cursor when the
pointer is moved over it. OK, I find that cursor tracking rects don't work
as advertised. So next I try to add tracking rects and just use those. But I
find that when the mouse is moved quickly, the newly-entered area will be
have its mouseEntered method called *before* the just-left area has its
mouseExited method called. This means that simply pushing and popping the
cursor on entry and exit won't work.

I don't see any way to get correct cursor behavior except to manage setting
the cursor within my window controller. I have to keep some state info about
which control is currently entered, so that on mouseEntered I know whether
mouseExited has already been called and can account for the exit if not, and
on mouseExited I know whether the exit was already taken into account by
handling an earlier enter event. Is there a better way?

Is this why in so many Cocoa applications I see the I-beam cursor continue
to be displayed after moving the pointer out of a text control, and often
see the cursor not change from the pointer to the I-beam when moving into a
text control???


--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 665-7007 voice


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Getting Data out of NSImages
  • Next by Date: debug problem
  • Previous by thread: Re: Getting Data out of NSImages
  • Next by thread: debug problem
  • Index(es):
    • Date
    • Thread