Home Segments Index Top Previous Next

694: Mainline

The getContents Smalltalk event occurs when a list box is created. Smalltalk responds by sending an initializeListBox: message to the CalorieViewManager instance.

To do its work, the initializeListBox: callback method must first obtain a list of foods. In preparation, you define the Food class as in Segment 455, you employ the file-reading program shown in Segment 456, and you define tCalories as in Segment 236.