![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Just as the meterValueHolder
getter
creates a new value holder the first time that it is sent, the meterViewHolder
getter creates a new meter the first time that it is sent:
MeterDemonstration method definition instance meterViewHolder ^ meterViewHolder isNil ifTrue: [meterViewHolder := Meter new. meterViewHolder min: 0; max: 10; title: 'Test Meter'. meterViewHolder model: self meterValueHolder. meterViewHolder] ifFalse: [meterViewHolder]
Note that, the first time that it is sent, meterViewHolder
getter
also does the following:
model
instance variable to be
the same as the value of the meterValueHolder
instance variable.