Home Segments Index Top Previous Next

649: Mainline

Next, several messages establish connections between the panes and the view manager:

CalorieViewManager method definition • instance 
createViews 
  | theCalorieViewManager theTopPane theMeterPane | 
  theCalorieViewManager := self. 
  theTopPane := TopPane new. 
  theMeterPane := MeterGraphPane new. 
  "Set up the top pane" 
  theCalorieViewManager addView: theTopPane. 
  theTopPane owner: theCalorieViewManager.  
  ... 
  "Set up the meter pane" 
  theTopPane addSubpane: theMeterPane. 
  theMeterPane owner: theCalorieViewManager. 
  ... 

The addView: message establishes that the view manager manages the top pane. This connection enables the view manager to display the panes on your screen and to close the application when you press the close button.

The owner: messages establish that the view manager is to receive information forwarded from the top pane and from the graph pane whenever the top pane or the graph pane receive notifications of events, such as mouse operations that require graphical information to be redrawn.

The addSubpane: message establishes that the graph pane is contained visually within the top pane.