home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.bin / SourceCode / MiniExamples / AppKit / TIFFandEPS / PopAndForm.m < prev    next >
Encoding:
Text File  |  1992-07-22  |  716 b   |  32 lines

  1. /* PopAndForm.m
  2.  *  Purpose: A small Object that controls a Popup connected to a Form
  3.  *
  4.  *  You may freely copy, distribute, and reuse the code in this example.
  5.  *  NeXT disclaims any warranty of any kind, expressed or  implied, as to its
  6.  *  fitness for any particular use.
  7.  *
  8.  */
  9. #import "PopAndForm.h"
  10.  
  11. @implementation PopAndForm : Object
  12.  
  13. - newValue:sender
  14. {
  15.     char *enteredValue = (char *)[formcell stringValue];
  16.     if  ([[popup target] indexOfItem:enteredValue] == -1)
  17.     [[popup target] addItem:enteredValue];
  18.     [popup setTitle:enteredValue];
  19.     [formcell setEnabled:NO];        
  20.     return self;
  21. }
  22.  
  23. - enableForm:sender
  24. {
  25.     [formcell setEnabled:YES];
  26.     [formcell selectTextAt:0];
  27.     return self;
  28. }
  29.  
  30.  
  31. @end
  32.