home *** CD-ROM | disk | FTP | other *** search
- //
- // 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
-