Re: scrollRangeToVisible
Re: scrollRangeToVisible
- Subject: Re: scrollRangeToVisible
- From: Jay Reynolds Freeman <email@hidden>
- Date: Fri, 11 May 2007 04:09:42 -0700
On May 10, 2007, at 5:24 AM, Gerriet M. Denkmann wrote:
> ... [too many view scrolls are too slow] ...
>
> So what I need is obviously something like:
> (void)justBeforeTheNextDisplayScrollRangeToVisible:(NSRange)aRange
>
> Is there something like this? Or what can be used instead?
There is a general approach which is not necessarily limited to
Cocoa, but there might be a useful way to implement it in Cocoa.
The general approach is to buffer the output: Append together
all the text sections you are going to log, as they are generated.
Put them in "textStorage", or perhaps somewhere else, as you wish,
and only call "scrollRangeToVisible" once, when it is time to
display the view.
Depending on what you are doing, you might have a handy place
in a pre-existing method somewhere, in which to put the call to
"scrollRangeToVisible". If no such means is at hand, you
might subclass your view and write a new version of "display"
for it, which checks for buffered text, adds it to the view
and scrolls to visible if there is any, and then passes
the "display" method on to its superclass.
I haven't tried this -- there may be gotchas, or other, better
ways.
-- Jay Reynolds Freeman
---------------------
email@hidden
http://web.mac.com/jay_reynolds_freeman (personal web site)
_______________________________________________
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