beautypg.com

Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 89

background image

C H A P T E R 3

Views

About Views

3-5

application base view. (Think of the view hierarchy as a tree structure in which
the tree is turned upside down with its root at the top. The top-level parent view is
the root view.)

Figure 3-2 shows the set of views instantiated from the templates shown in
Figure 3-1. Note that this example is simplified in that it shows a separate template
for each view. In practice, multiple views often share a single template. Also, this
example doesn’t show templates that are built on other protos.

Figure 3-2

View hierarchy

Arrows indicate a
reference to parent/child

Templates

(permanent, read-only)

Views

(transient, writable)

Arrows indicate a
reference to protos

Parent View

{_proto:
.
.
.
}

Child Template C

{
.
.
.
}

Child Template B

{
.
.
.
}

Child Template D

{
.
.
.
}

Parent Template

{
.
.
.
viewChildren:[]
}

Child Template A

{
.
.
.
viewChildren:[]
}

Child View B

{
.
_parent:
_proto:
.
}

Child View A

{_parent:
_proto:
.
.
.
}

Child View D

{
.
_parent:
_proto:
.
}

Child View C

{_parent:
_proto:
.
.
.
}