Re: Scrolling
Re: Scrolling
- Subject: Re: Scrolling
- From: Eric Peyton <email@hidden>
- Date: Thu, 12 Jul 2001 13:25:09 -0500
Why don't you just set the viewable portion of the text view?
Scroll it yourself ...
From Fire.app source code ... notice the last line before the return.
- (void)addMessageToConsole:(NSString *)aMessage
{
if ([[consoleText textStorage] length]) {
[consoleText
replaceCharactersInRange:NSMakeRange([[consoleText textStorage]
length], 0) withString:@" \n"];
}
[consoleText replaceCharactersInRange:NSMakeRange([[consoleText
textStorage] length], 0) withString:[[NSDate date]
descriptionWithCalendarFormat:@"%I:%M %p" timeZone:nil locale:nil]];
[consoleText replaceCharactersInRange:NSMakeRange([[consoleText
textStorage] length], 0) withString:@" - "];
[consoleText replaceCharactersInRange:NSMakeRange([[consoleText
textStorage] length], 0) withString:aMessage];
[consoleText scrollRangeToVisible:NSMakeRange([[consoleText
textStorage] length], 0)];
return;
}
Eric
On Thursday, July 12, 2001, at 12:37 PM, Ben Woodward wrote:
Hi there,
I am writing an app which is displaying a load of text
(potentially). It
would be really cool, if I could tell my window to jump to the
bottom of the
page at certain point (like Terminal can) : when new stuff arrives, on
opening the window, when I feel like it would be the least
opportune moment,
oh hang on I'm not writing a M$ app! :) It looks like in
NSClipView, there
is a method called:
public void scrollToPoint(NSPoint newOrigin). This seems really
cool, but
unfortunately, I am new enough to all this to not have a clue how
to use it.
Any suggestions would be much appreciated.
Sincerely, Ben
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
References: | |
| >Scrolling (From: Ben Woodward <email@hidden>) |