Build Your First Application

Put Templates in a Parent-Child Hierarchy

The first template you create in a layout window serves as the main parent template. There can only be one parent of this type in a layout. If you try to create another template that isn't a child of the first template, you will get the NTK alert shown in FIGURE 2.23.

Just remember that every layout file must have a base parent template--NTK insists on the single-head-of-household filing status. Inside that parent, however, you can have as many children as you wish.

To make sure that a template is created as a child of another template, you simply drag out the child template shape inside the parent.

FIGURE 2.23 : NTK alert warning of a parent clash.


To continue with this tutorial, draw out a protoLabelInputLine as a child of the protoApp. Then, draw out a protoCheckbox, also as a child of the protoApp (see FIGURE 2.24).

FIGURE 2.24 : Layout file after drawing a protoLabelInputLine and protoCheckbox.


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

Last modified: 1 DEC 1996