Configuration of Some System Protos

protoLabelInputLine

A protoLabelInputLine is actually composed of more than one template. One is used for the label static text, while another is used for the input line. The label is named "labelLine" and is declared to its parent. The input line is named "entryLine" and is declared to the same parent, the protoLabelInputLine.

FIGURE 7.5 shows the browser for myLabelInputLine, a template based on protoLabelInputLine (the entryLine and labelLine are not slots in the template but rather get created at runtime). FIGURE 7.6 shows you the final runtime view of myLabelInputLine and its new children views, entryLine and labelLine.

FIGURE 7.5 : NTK Browser showing the slots in a protoLabelInputLine.


FIGURE 7.6 : Runtime views of myLabelInputLine.


Since input occurs in a child of the protoLabelInputLine, the text slot of the child (myLabelInputLine.entryLine.text) contains the current text, rather than the text slot of the parent (myLabelInputLine.text). A protoLabelInputLine does have a text slot, but it is only used to provide an initial value for the text slot of the entryLine child. Similarly, it should also be obvious why the viewFlags slot of the parent protoLabelInputLine doesn't affect recognition settings in the child entryLine. Instead, a slot named entryFlags of a protoLabelInputLine is used to initialize the viewFlags of the entryLine.


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996