This is Appender.m in view mode; [Download] [Up]
/* Appender.m
* 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 <appkit/appkit.h>
#import "Appender.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 = [[scrollView docView] textLength];
[[scrollView docView] setSel:currentLength :currentLength];
[[scrollView docView] replaceSel:newText];
[[scrollView 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.