beautypg.com

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

Page 115

background image

C H A P T E R 3

Views

About Views

3-31

New Alignment Flags

3

The

viewJustify

slot contains new constants that allow you to specify that a

view is sized proportionally to its sibling or parent view, both horizontally and/or
vertically.

A change to the way existing

viewJustify

constants work is that when you are

using sibling-relative alignment, the first sibling uses the parent alignment settings
(since it has no sibling to which to justify itself).

Changes to Existing Functions and Methods

3

The following changes have been made to existing functions and methods for 2.0.

RemoveStepView

. This function now removes the view template from the

stepChildren

array of the parent view. You do not need to remove the

template yourself.

SetValue

. You can now use this global function to change the recognition

behavior of a view at run time by setting new recognition flags in the

viewFlags

slot. The new recognition behavior takes effect immediately

following the

SetValue

call.

GlobalBox

. This method now works properly when called from the

ViewSetupFormScript

method of a view. If called from the

ViewSetupFormScript

method,

GlobalBox

gets the

viewBounds

and

ViewJustify

slots from the view, calculates the effects of the sibling and

parent alignment on the view bounds, and then returns the resulting bounds
frame in global coordinates.

LocalBox

. This method now works properly when called from

the

ViewSetupFormScript

method of a view. If called from the

ViewSetupFormScript

method,

LocalBox

gets the

viewBounds

and

ViewJustify

slots from the view, calculates the effects of the sibling and

parent alignment on the view bounds, and then returns the resulting bounds
frame in local coordinates.

ViewQuitScript

. When this message is sent to a view, it propagates down to

child views of that view. In system software version 1.0, the order in which child
views received this message and were closed was undefined.

In system software version 2.0, the order in which this message is sent to
child views is top-down. Also, each view has the option of having

ViewPostQuitScript

called in child-first order. The return value of

the

ViewQuitScript

method determines whether or not the

ViewPostQuitScript

message is sent.