beautypg.com

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

Page 390

background image

C H A P T E R 1 0

Recognition: Advanced Topics

10-14

Using Advanced Topics in Recognition

To obtain the best performance and to conserve available memory, create your

rcBaseInfo

frame by cloning the frame provided by the

ROM_canonicalBaseInfo

constant. Store your frame in a slot named

rcBaseInfo

in your input view’s

recConfig

frame.

For a detailed description of the

rcBaseInfo

frame, see “Data Structures Used in

recConfig Frames” (page 8-24) in Newton Programmer’s Reference.

The rcGridInfo Frame

10

The

rcGridInfo

frame allows you to define the position of one or more single-

letter input areas within a single input view. Its purpose is to facilitate the creation
of views having multiple single-letter input areas, such as might be used by a
crossword puzzle application. Providing a separate view for each single letter input
area would be extremely inefficient; the use of an

rcGridInfo

frame allows you

to draw one view that provides the illusion of many input views, by defining to the
recognizer the size of an individual input area and the spacing between input areas.

Figure 10-4 depicts an example of the grid that an

rcGridInfo

frame defines.

The boxes shown in this figure are not views themselves, just lines on the screen
that indicate the location of the input areas to the user. The recognition behavior is
provided by the view that draws these boxes; the

rcGridInfo

frame helps the

recognizer determine the precise location of user input, and, consequently, where to
display its output. By providing the proper slots, you can use an

rcGridInfo

frame to define a row, column, or matrix (as shown in the figure) of single-letter
input areas within a view.

Figure 10-4

Two-dimensional array of input boxes specified by

rcGridInfo

frame

boxRight

boxBottom

boxTop

xSpace

ySpace

boxLeft