home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / OOP_Course / Examples / ShiftInspector / ShiftInspector.m < prev    next >
Encoding:
Text File  |  1993-01-19  |  1.1 KB  |  51 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import "ShiftInspector.h"
  5. #import <appkit/appkit.h>
  6.  
  7. @implementation ShiftInspector
  8.  
  9. - appDidInit:sender
  10.     //When app inits, install first view in Inspector.
  11.     id    aView;
  12.     aView=[[View alloc] init];  //create a new contentView
  13.     arrayView=[inspectorArray setContentView:aView];  //swap,get array of inspector views
  14.     [inspectorArray free];  //we have the view, no longer need this
  15.     [inspectorView addSubview:arrayView]; //add to inspector's view
  16.     [arrayView moveTo: 0.0 :0.0]; //start with leftmost (counter) view
  17.     [inspectorView display];
  18.     return self;
  19. }
  20.  
  21. - changeToCounter:sender
  22. {
  23.     [arrayView moveTo:0.0 :0.0]; //move view to counter 
  24.     [inspectorView display];
  25.     return self;
  26. }
  27. - changeToSquarer:sender
  28. {
  29.     [arrayView moveTo:-200.0 :0.0]; //move view to squarer
  30.     [inspectorView display];
  31.     return self;
  32. }
  33.  
  34. - count:sender
  35. {
  36.     [countDisplay setIntValue:([countDisplay intValue]+1)];
  37.     return self;
  38. }
  39.  
  40. - square:sender
  41. {
  42.     float value=[sender floatValue];
  43.     [squareRoot setFloatValue:value];
  44.     [square setFloatValue:(value*value)];
  45.     return self;
  46. }
  47.  
  48.  
  49. @end
  50.