Justification

Sibling Justification

You are not limited to parent justification. All the same choices are available relative to a view's sibling as well. In fact, you will frequently have a number of sibling views which you will want to draw out relative to one another rather than to a parent. Sibling justification provides this ability. Rather than measuring from the parent, sibling justification measures from the previous sibling.

A view's sibling is always the sibling prior to it in the NTK browser window (see FIGURE 5.23).

FIGURE 5.23 : Identifying a view's sibling.


The types of sibling justification are similar to those of parent justification:

siblingRelativeLeft
The left and right viewBounds slots are measured from the previous sibling's left viewBounds slot.

siblingRelativeRight
The left and right viewBounds slots are measured from the previous sibling's right viewBounds slot.

siblingRelativeTop
The top and bottom viewBounds slots are measured from the previous sibling's top viewBounds slot.

siblingRelativeBottom
The top and bottom viewBounds slots are measured from the previous sibling's bottom viewBounds slot.

siblingRelativeFull
For vertical justification, top and bottom viewBounds slots are measured from the previous sibling's top and bottom slots.
For horizontal justification, left and right viewBounds slots are measured from the previous sibling's left and right viewBounds slots.

siblingRelativeCenter
For vertical justification, the view is centered within its previous sibling's height and then offset by the top viewBounds slot.
For horizontal justification, the view is centered within its previous sibling's width and then offset by the left viewBounds slot.


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

Last modified: 1 DEC 1996