home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Examples / DatabaseKit / AddressBook / Appender.m < prev    next >
Text File  |  1992-07-09  |  732b  |  32 lines

  1. /* Appender.m
  2.  * You may freely copy, distribute, and reuse the code in this example.
  3.  * NeXT disclaims any warranty of any kind, expressed or  implied, as to its
  4.  * fitness for any particular use.
  5.  */
  6.  
  7. #import <appkit/appkit.h>
  8. #import "Appender.h"
  9.  
  10. @implementation Appender
  11.  
  12. /* Prints the doc view of the scroll view
  13. */
  14. - print:sender
  15. {
  16.     [[scrollView docView] printPSCode:self];
  17.     return self;
  18. }
  19.  
  20. /* Appends the string passed to the doc view of the scroll view
  21.  */
  22. - appendToText:(const char *)newText
  23. {
  24.     int currentLength = [[scrollView docView] textLength];
  25.     [[scrollView docView] setSel:currentLength :currentLength];
  26.     [[scrollView docView] replaceSel:newText];
  27.     [[scrollView docView] scrollSelToVisible];
  28.     return self;
  29. }
  30.  
  31. @end
  32.