home *** CD-ROM | disk | FTP | other *** search
- //
- // An Object to Append Text to IB's Default ScrollView
- // Randy Nelson—Copyright NeXT Computer, Inc 1990 All Rights Reserved
- // Created 5-1-90
- // Modified 9-3-90 -- Removed outlet initializers.
- //
- // You may freely copy, distribute and reuse the code in this example.
- // NeXT disclaims any warranty of any kind, expressed or implied, as to
- // its fitness for any particular use.
- //
-
- #import "Appender.h"
- #import <appkit/ScrollView.h>
- #import <appkit/Text.h>
-
- @implementation Appender
-
- //prints the doc view of the scroll view
- - print:sender
- {
- [[scrollView docView] printPSCode:self];
- return self;
- }
-
- //appends the string passed to the doc view of the scroll view
- - appendToText:(const char *)newText
- {
- int currentLength;
-
- currentLength = [[scrollView docView] textLength];
- [[scrollView docView] setSel:currentLength :currentLength];
- [[scrollView docView] replaceSel:newText];
- [[scrollView docView] scrollSelToVisible];
- return self;
- }
- @end
-