• 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: drawRect problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: drawRect problem


  • Subject: Re: drawRect problem
  • From: Ken Tozier <email@hidden>
  • Date: Mon, 26 Feb 2007 18:50:48 -0500

Thanks Uli.

After several more hours of plugging, I did finally manage to get it working.

On Feb 25, 2007, at 3:29 PM, Uli Kusterer wrote:

I'm not sure you want to use a timer for a mouseOver. Use a mouse tracking region. That way you're notified whenever the mouse moves to another view, and you don't burn cycles checking NSEqualPoints() needlessly.

I'm using a tracking rect on the whole view and mouseEntered/ mouseExited to turn the timer on and off. I found through testing that Cocoa was getting really bogged down when I used a tracking rect for each cell in the view. If you moved the mouse rapidly all over the view, it was possible to get 5 to 10 seconds ahead of the refreshing and you could just sit there and watch as it struggled to catch up. The "sampleMouse" method turned out to be many times more responsive. I can move the mouse as fast as I physically can and it has no problem keeping up with me.

I'm also not sure you want to set lastCell to NIL in drawRect. That means that your unhighlighting code doesn't have a cell to unhighlight anymore :-S

I ended up having to store two references. One for "lastCell" and one for the "mouseCell". Once I did that, I was able to get the hilight/ unhilight working as expected.


Ken



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >drawRect problem (From: Ken Tozier <email@hidden>)
 >Re: drawRect problem (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: Help: Mac as a Terminal
  • Next by Date: Re: Help: Mac as a Terminal
  • Previous by thread: Re: drawRect problem
  • Next by thread: Xcode Developer Documentation
  • Index(es):
    • Date
    • Thread