Apple Newton Utilities Guide de l'utilisateur Page 906

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 942
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 905
APPENDIX
A-2 Run-Time Results
Note
Protos built into the system use an analogous slot called
allocateContext, that holds the same thing as
stepAllocateContext. The allocateContext slot is for
declared children from the
viewChildren array and the
stepAllocateContext slot is for declared children from the
stepChildren array.
Also, as a result of the declare operation, NTK creates a slot in the Display template
called
preallocatedContext. This slot holds a symbol that is the name of the
template, in this case
'Display. This symbol will be used by the system when the
view is instantiated to nd the preallocated view memory object for the Display view.
Run-Time Results 26
When the Calculator view is opened (even before its ViewSetupFormScript
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
allocateContext and stepAllocateContext slots.) In our example, a view
memory object is created for the Display view.
The
Display 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
preallocatedContext slot, and knows
that a view memory object has been preallocated for this view. Using this slot, the
system can nd the preallocated view.
The value of the
preallocatedContext slot is the name of another slot in the
Calculator view. The system locates this slot in the Calculator view, and nds 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.
Vue de la page 905
1 2 ... 901 902 903 904 905 906 907 908 909 910 911 ... 941 942

Commentaires sur ces manuels

Pas de commentaire