beautypg.com

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

Page 316

background image

C H A P T E R 8

Text and Ink Input and Display

8-24

Using Text

view’s

'text

and

'styles

slots are generated and placed in the context frame of

the view.

When

SetValue

is called with a string parameter that is a rich string, it is

automatically decoded into a text and style pair. The result is stored in the view
frame of the paragraph view.

Rich String Functions

8

You can use the rich string functions to convert and work with rich strings. Each of
these functions, shown in Table 8-7, is described in “Rich String Functions and
Methods” (page 7-31) in Newton Programmer’s Reference.

Table 8-7

Rich string functions

Function or method name

Description

MakeRichString

Converts the data from two slots into a rich
string.

MakeRichString

uses the text

from the '

text

slot of the view and the

styles

array from the '

styles

slot of the

view.

DecodeRichString

Converts a rich string into a frame containing
a

'text

slot and a

'styles

slot. These

slots can be placed in a paragraph view for
editing or viewing.

ExtractRangeAsRichString

Returns a rich string for a range of text
from a paragraph view.

IsRichString

Determines if a string is a rich string
(i.e., contains ink).

view:GetRichString

Returns the text from a paragraph view as a
rich string or plain string, depending on
whether the paragraph view contains
any ink.

StripInk

Strips any ink from a rich string. Either
removes the ink words or replaces each
with a specified replacement character
or string.