Home Segments Index Top Previous Next

879: Mainline

Add a when:perform: statement to creatViews such that the top pane responds to a close event by sending a close: message to the view manager. For example, for the calorie-dictionary application, you add the when:perform: statement as follows:

CalorieViewManager method definition • instance
createViews
  | theTopPane theListBox theMeterPane theMenuWindow |
  ...
  "Set up the top pane"
  theTopPane owner: self;
    ...
    menuWindow: (theMenuWindow := MenuWindow new);
    when: #close perform: #close:;                              
    framingRatio: (1/4 @ (1/3) rightBottom: 3/4 @ (2/3)).  
    ... 
  ... 

See Segment 875 for the complete createViews method.