beautypg.com

Displaying text and ink 8 – Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 306

background image

C H A P T E R 8

Text and Ink Input and Display

8-14

Using Text

IMPORTANT

You can programmatically access the value of the

text

slot for

the

protoLabelInputLine

with the expression

entryLine.text

. If you update the text slot programmati-

cally, you need to call the

SetValue

function to ensure that the

view is updated. Below is an example:

SetValue(entryLine, 'text, "new text")]

The following is an example of a template using

protoLabelInputLine

:

labelLine := {...

_proto: protoLabelInputLine,

viewBounds: {top: 90, left: 42, right: 194, bottom: 114},

label: "Who",

labelCommands: ["Me", "You", "Us", 'pickseparator,

"Them", "No one"],

curLabelCommand: 0,

...}

The slots of the

protoLabelInputLine

are described in “protoLabelInputLine”

(page 7-19) in Newton Programmer’s Reference.

protoRichLabelInputLine

8

This proto works exactly like

protoLabelInputLine.

The only difference is

that

protoRichLabelInputLine

allows mixed ink and text input, as

determined by the current user recognition preferences.

The slots of the

protoRichLabelInputLine

are described in

“protoRichLabelInputLine” (page 7-22) in Newton Programmer’s Reference.

Displaying Text and Ink

8

In addition to knowing about the views and protos that you can use for displaying
text and ink, you should understand how text and ink are displayed. This involves
the use of fonts, text styles, and rich strings. This section describes these objects
and how you can use them in your applications to control the display of text and ink.

Text and Ink in Views

8

When the user draws with the pen on the Newton screen, pen input data is captured
as ink, which is also known as sketch ink or raw ink.

What happens with the raw ink depends upon the configuration of the view in
which the input action was performed and the choices that the user made in the