Home Segments Index Top Previous Next

800: Mainline

So far, you have seen that a changed: message causes update: messages to be sent. Now, you need to know that such changed messages are most often sent inside setters, as in the following setters of the x and y instance variables. Note that the aspect argument identifies the instance variable—that is, the aspect—that changes.

ModelSubclass method definition • instance 
setX: value 
  x := value. 
  self changed: #x. 
ModelSubclass method definition • instance 
setY: value 
  y := value. 
  self changed: #y. 
M setX: 0. 
M setY: 1. 
Sample viewer receiving #x update message 
Sample viewer receiving #y update message