beautypg.com

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

Page 398

background image

C H A P T E R 1 0

Recognition: Advanced Topics

10-22

Using Advanced Topics in Recognition

When the view receives input, it uses parent inheritance to find configuration
information. If a

_recogSettings

slot exists in the view’s

_parent

chain, the

view uses the value of this slot, along with values supplied by an optional

recConfig

frame and values inherited from the system’s user configuration data.

The

recToggle

view’s

ViewSetupFormScript

method uses the value of the

_recogSettings

slot to set the state of the

recToggle

view. To restore the

recognition settings that were in effect the last time your application was used, you
can save the value of the

_recogSettings

slot when the application closes and

restore the value of this slot when the application reopens. If you prefer that the

recToggle

view always open to a default setting, rather than a saved one, you

can place the value

nil

in the

_recogSettings

slot when your application opens.

Providing the _recogPopup Slot

10

You can customize the appearance and behavior of your

recToggle

view by

providing a

_recogPopup

slot in its view template. This slot contains an array of

symbols corresponding to items included in the picker that the

recToggle

view

displays. The first item in the array appears at the top of the picker and specifies the
default recognizer enabled by the

recToggle

view. The picker includes subsequent

items in the order in which they appear in the array.

Table 10-2 summarizes the symbols that may appear in the

_recogPopup

slot,

along with the corresponding item each produces in the

recToggle

picker.

To specify that the

recToggle

view enable a default recognizer other than the one

specified by the first symbol in the

_recogPopup

array, your

recToggle

view’s

template can provide a

defaultItem

slot. This slot holds an integer value

specifying the array element to be used as the default.

Table 10-2

Symbols appearing in the

_recogPopup

slot

Symbol

Represents

Picker item

'recogText

Text recognizer

Text

'recogInkText

Ink text

Ink Text

'recogShapes

Shape recognizer

Shapes

'recogSketches

Raw ink

Sketches

'recToggleSettings

Handwriting Recognition
preferences slip

Preferences

'pickSeparator

No selection

Dashed line