• 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: Knowing if a scroll view is being scrolled
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Knowing if a scroll view is being scrolled


  • Subject: Re: Knowing if a scroll view is being scrolled
  • From: James Bucanek <email@hidden>
  • Date: Thu, 15 Feb 2007 08:15:18 -0700

Half Activist wrote on Wednesday, February 14, 2007:
>   Is there a way to know if a scroll view is being scrolled?
>   I mean, I'm have a rather big view, that draws shadings, and there
>can be a lot of them,
>   and it slows down everything.
>   What I'd like to do, is when drawing, change my drawing technics
>while scrolling
>   and at the end draw in full quality, somewhat like the
>isInLiveResize feature of NSView.

To the best of my knowledge, there is no "DidFinishScrolling" notification. Scroll views scroll and then redraw, but there's no way to tell if the user is finished scrolling or not.

The approach I would take would be to simply defer your finished rendering until later. Whenever a new drawRect message is received perform a fast draw and start an NSTimer to fire in, say, 1 second. When the timer fires, change states and redraw using the full rendering. If a new drawRect is received before the timer fires, reset/invalidate the timer and repeat.

The beauty of this scheme is that it doesn't matter what is redrawing or why; scrolling, resizing, opening, etc will all respond quickly, then update with the full rendering a second or so later.

--
James Bucanek
_______________________________________________

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

  • Follow-Ups:
    • Re: Knowing if a scroll view is being scrolled
      • From: Half Activist <email@hidden>
References: 
 >Knowing if a scroll view is being scrolled (From: Half Activist <email@hidden>)

  • Prev by Date: Re: Newbie Q: Is it possible to draw functional "Cocoa Controls" in an OpenGL context?
  • Next by Date: Re: Frustration trying to get NSConnection/NSPort working (feels like it should be simpler ...)
  • Previous by thread: Knowing if a scroll view is being scrolled
  • Next by thread: Re: Knowing if a scroll view is being scrolled
  • Index(es):
    • Date
    • Thread