A P P E N D I X
Protos built into the system use an analogous slot called
, that holds the same thing as
slot is for
declared children from the
array and the
slot is for declared children from the
Also, as a result of the declare operation, NTK creates a slot in the Display template
. This slot holds a symbol that is the name of the
template, in this case
. This symbol will be used by the system when the
view is instantiated to find the preallocated view memory object for the Display view.
When the Calculator view is opened (even before its
method is executed), a view memory object is preallocated for each view declared
in Calculator. (The information required to do this is obtained from the
slots.) In our example, a view
memory object is created for the Display view.
slot in the Calculator view is updated so that it points to the newly
allocated Display view object.
Later in the instantiation process for the Calculator view, its child views are created
and shown, including the Display view. At this time, the view system looks at the
template for the Display view, sees the
slot, and knows
that a view memory object has been preallocated for this view. Using this slot, the
system can find the preallocated view.
The value of the
slot is the name of another slot in the
Calculator view. The system locates this slot in the Calculator view, and finds there
a reference to the preallocated view object. Instead of creating a new view object
for the Display view, the system uses the preallocated view.