home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / RB3641.ZIP / EX1 / TESTVW1.CLS < prev    next >
Text File  |  1991-12-16  |  1KB  |  52 lines

  1.  
  2. ViewManager subclass: #TestView
  3.   instanceVariableNames: ''
  4.   classVariableNames: ''
  5.   poolDictionaries: 
  6.     'PMConstants '  !
  7.  
  8.  
  9. !TestView class methods ! !
  10.  
  11.  
  12.  
  13. !TestView methods !
  14.    
  15. myMenu
  16.         "Private - Answer the File menu."
  17.     ^Menu new
  18.         appendItem: '~My Choice' selector: #myMenuMethod ;
  19.       title: '~My Menu'!
  20.   
  21. myMenuMethod
  22.          "This method is activated when 'MyChoice'
  23.           is selected in the pulldown 'My Menu'"
  24.  
  25.          MessageBox
  26.                     titled: 'Gotcha!!!!!!'
  27.                     withText: 'My menu WORKS !!!!!!'
  28.                     style: MbOk | MbIconexclamation.!
  29.   
  30. mySelect: aListBox!
  31.  
  32. myTextList: aListBox!
  33.    
  34. open
  35.         "Open an window containing a ListBox"
  36.  
  37.  
  38.     self
  39.         owner: self;
  40.         label: 'A TEST';
  41.         yourself.
  42.  
  43.     self addSubpane:
  44.         (ListBox new
  45.             owner: self;
  46.             when: #getContents perform: #myTextList: ;
  47.             when: #select perform: #mySelect:;
  48.             framingBlock: [:box | box]).
  49.  
  50.      self openWindow.
  51.      self menuWindow addMenu: self myMenu owner: self.! !
  52.