![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
In Chapter 39, you learned that you can define setters for various
instance variables in a model such that those setters send changed:
messages, which in turn cause model instances to send update:
messages to dependent parts. It was up to you to decide which setters
send changed:
messages.
The ValueHolder
class comes equipped with one instance variable,
value
, with a getter, value
, and a setter,
value:
(inherited from the ValueModel
class), for the
value
instance variable. The setter sends the changed:
message with #value
as the aspect argument:
ValueHolder class definition Object subclass: #ValueHolder instanceVariableNames: 'value' classVariableNames: '' poolDictionaries: '' category: 'Interface-Support' ValueHolder method definition instance value ^ value ValueModel method definition instance value: newValue value := newValue self changed: #value