Home Segments Index Top Previous Next

812: Mainline

Of course, you can define a controller to send the sort of messages expected by a value holder:

ControllerSubclass class definition 
Controller subclass: #ControllerSubclass 
  instanceVariableNames: '' 
  classVariableNames: '' 
  poolDictionaries: '' 
  category: 'Experiment' 
ControllerSubclass method definition • instance 
simulateClick 
  Transcript show: 'Button click simulated'; cr. 
  self model value: (self model value + 1). 

Then, the controller can write into the same value holder that sends updates to the viewer:

Workspace
C := ControllerSubclass new. 
C model: H. 
C simulateClick. 
Transcript 
Button click simulated 
Sample viewer receiving #value update message 
Value, determined in viewer, is 2