- If you want to define a new widget, then define a subclass of the
View
class and then define the displayOn:
method for that
class, by instantiating the following pattern:
displayOn: thePen
| ... modelValue ... |
...
modelValue := self model value.
...
- If you want to deploy a widget that you have defined yourself, then define
your application model with instance variables to hold an instance of
the widget and an instance of a value holder for the widget, and then
place a view holder in a canvas, specifying, as the view property of the
view holder, an application model getter, and then define that
application-model getter such that it produces an instance of the
widget, by instantiating the following pattern, in which the selector
and instance variable have the same name:
selector
^ instance variable isNil
ifTrue: [instance variable := widget class new.
instance variable model: self a value holder.
instance variable]
ifFalse: [instance variable]
- Whenever a viewer is created, a companion controller is created as well.
- If you want to alter the controller used as a viewer companion, then
define
defaultControllerClass
by instantiating the following pattern:
defaultControllerClass
^ name of controller class
- If you want to define a controller, then define a subclass of
the
Controller
class and implement the controlActivity
method for that subclass.