home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula
/
nebula.bin
/
SourceCode
/
MiniExamples
/
PerformanceTuning
/
VisibleView-01
/
Appender.m
< prev
next >
Wrap
Text File
|
1991-10-18
|
743b
|
38 lines
//
// 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