ftp.nice.ch/pub/next/developer/objc/fromnext/MiniExamples.91.9.s.tar.gz#/MiniExamples/PerformanceTuning/VisibleView-01/Appender.m

This is Appender.m in view mode; [Download] [Up]

//
//	An Object to Append Text to IB's Default ScrollView
//	Randy NelsonÐCopyright NeXT 1990
//	Not for release or reuse
//

#import "Appender.h"
#import <appkit/ScrollView.h>
#import <appkit/Text.h>

@implementation Appender

//initializes the outlet
- setScrollView:anObject
{
    scrollView = anObject;
    docView = [scrollView docView];
    return self;
}

//prints the doc view of the scroll view
- print:sender
{
	[docView printPSCode:self];
	return self;
}

//appends the string passed to the doc view of the scroll view
- appendToText:(const char *)newText
{
	int currentLength = [docView textLength];
	[docView setSel:currentLength :currentLength];
	[docView replaceSel:newText];
	[docView scrollSelToVisible];
	return self;
}
@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.