Common View Slots
FIGURE 5.3 : The viewBounds
slot of a protoApp
.
viewBounds
slot defines the size and coordinates of a view (see FIGURE 5.3). This slot is itself a frame that contains four slots, one slot each for the left, right, top, and bottom coordinates of a view. Later in this chapter you will learn how the values in viewBounds
depend upon the values found in the viewJustify
slot. For now, simply realize that these viewBounds
values are integer values that specify view location and size relative to some other view. When no other view is specified, the view's parent is used by default.
Thus, if you have parent and child views with these viewBounds
:
Parent: Child:
left: 0, left: 0, right: 80, right: 40, top: 0, top: 0, bottom: 80 bottom: 40you will have a child view half as wide and high as its parent and nestled in the top left corner (see FIGURE 5.4).
FIGURE 5.4 : A child view inside a parent view.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996