Re: Automatically scrolling to the bottom
Re: Automatically scrolling to the bottom
- Subject: Re: Automatically scrolling to the bottom
- From: Andreas Monitzer <email@hidden>
- Date: Mon, 6 Aug 2001 18:22:15 +0200
On Monday, August 6, 2001, at 05:43 , Christian Mike wrote:
I have an NSScrollView that functions as a log window. As text enters this
window, I see the vertical scroll bar appear, just as I'd expect, and the
scroll button size shrinks to reflect the proportion of text visible
versus
the amount available. This part all works fine. However, I have found that
the NSScrollView does not automatically scroll so that the "latest" stuff
at
the bottom of the window is visible. It only displays the oldest stuff at
the top.
How do I programmatically move a scroll view to the bottom? I am always
programmatically placing the insert point cursor at the bottom so that new
stuff comes out appended to the bottom, if that helps any.
"text" is the NSTextView (*not* the NSScrollView),
NSRange theEnd=NSMakeRange([[text string] length],0); // you should need
that for appending, too
[text scrollRangeToVisible:theEnd];
andy
--
"He was addicted to life. But we cured him"