Re: Knowing if a scroll view is being scrolled
Re: Knowing if a scroll view is being scrolled
- Subject: Re: Knowing if a scroll view is being scrolled
- From: Half Activist <email@hidden>
- Date: Thu, 15 Feb 2007 16:30:04 +0100
Hi James,
Yeah, this is exactly what I was thinking about, but I wanted to
know if there wasn't a 'cleaner' way to do this.
The problem of this is if the content of the view is being drawn to
a custom context, say an imagerep or something like that,
the fast drawing technique must then be disabled.
However, if no other options are offered to me, I'll certainly have
to go this way, but I'll go for a much smaller time interval,
something about 1/10th second, so the user feels it smooth and
beautiful at the same time.
Thanks for your answer
Regards.
On Feb 15, 2007, at 4:15 PM, James Bucanek wrote:
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