How Views Are Created
viewSetupFormScript
message is sent before the viewCObject
of a view is created. A number of the viewCObject
's aspects are determined when it is created by slots in the view. Because of this, the viewSetupFormScript
is the only place you can modify those slots and have the viewCObject
notice. For instance, viewBounds
, viewJustify
, and viewFormat
are some of the slots that the viewCObject
reads from the view.
It follows that if you want to modify the values of those slots when the view is initialized, this is the place to do it. The viewSetupFormScript
can override slots in the template. This ensures that the viewCObject
reads the overridden slots rather than the template's slots. Here are some of the more typical aspects of a view that you use viewSetupFormScript
to modify at run-time:
viewBounds
slot--to set the size of the view
viewJustify
slot--to set the justification of the view dynamically
inherited:?view...Script()
By using :?
syntax (see "The :? Operator" on page 92), you'll take care of the case where there is such a method in the proto, as well as the case where there is not.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996