beautypg.com

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

Page 635

background image

C H A P T E R 1 7

Additional System Services

Using Additional System Services

17-19

2. Open the status slip. There are three parts to this process:

Instantiate your status view by passing its template to the

BuildContext

function.

Initialize the status slip by passing the template’s setup frame to the status
slip’s

ViewSet

method.

Invoke the status slip’s

Open

method to display the slip.

3. Perform the operation on which you are reporting progress, updating the status

slip periodically by invoking the status view’s

UpdateIndicator

or

ViewSet

method.

4. Write a

CancelRequest

method which is executed when the user cancels

your operation with a “Cancel” or “Stop” button. If your action cannot be
cancelled, do not provide such a button.

Each of these steps is described in detail in the following sections.

Defining Status View and Component View Templates

17

You can create a status slip view from the system-supplied templates

vStatus

,

vGauge

,

vBarber

,

vConfirm

,

vProgress

, or

vStatusTitle

(shown in

Figure 17-8), or you can create your own template for this view.

Your status view template must have a

_proto

slot that holds the value

protoStatusTemplate

. It may also include

Methods and data that must be available to the status view or its child views.

An optional

initialSetup

slot. If this slot is present, the view system uses its

contents to initialize the status slip automatically when the slip is opened.

A frame describing a custom component template. This is needed only if you do
not wish to use one of the built-in templates. This frame must contain the
following slots:

height

Height of the status slip, (not the component view) expressed
in pixels. Making this value part of the component view
template allows status slips to resize themselves based on the
height specified by their component views.

name

A symbol representing this template to the

ViewSet

method. For example, if the name of your component
template is

'

vMyBarber

, this slot should hold the

'

vMyBarber

symbol.

kids

Array of frames specifying the view templates used to
instantiate the components of this view. These templates
should be based on one of the protos described in “Status
View Components” (page 14-14) in Newton Programmer’s
Reference
.