
Creating and Modifying Templates
Putting Templates in a Parent-Child Hierarchy
The first template that 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 A.19.

FIGURE A.19 : NTK alert warning of a parent clash.
Just remember that every layout file must have a base parent template--NTK insists on the single-head-of-household filing status. Inside of 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 as in FIGURE A.20. You can also change the template hierarchy if you don't get it positioned correctly on the first try (see "The Template Area of the Browser" on page 403).

FIGURE A.20 : Dragging out child templates.
Notice in FIGURE A.20 that the child template of the protoStaticText template is drawn longer than its parent. This does not change its place in the hierarchy, which is set by where you first start to draw a template. If a child view is longer or wider than its parent, it will draw outside its parent on the Newton, unless the parent had its vClipping
bit set in viewFlags
. In the latter case, the child view will be clipped off at the edge of the parent. NTK always displays children clipped to their parent, regardless of the vClipping
bit setting.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996