beautypg.com

Using progress indicators 17 – Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 631

background image

C H A P T E R 1 7

Additional System Services

Using Additional System Services

17-15

2. Define another method in your application’s base view named

PeriodicAlarm

.

This method is called whenever the alarm “goes off.” This method is passed a
single parameter, alarm, that contains information about the present alarm. For
information on the alarm parameter, see

PeriodicAlarm

in Newton

Programmer’s Reference.

3. Create a view that is based on

protoPeriodicAlarmEditor

. You need to

set three slots in this view:

A

title

slot set to a string that is displayed at the top of the view.

An

ownerSymbol

slot set to your application symbol. The system sends

PeriodicAlarm

messages are sent to

GetRoot().(ownerSymbol)

.

An

ownerApp

slot set to a string that names of your application.

IMPORTANT

Do not add child views to a view that is based on

protoPeriodicAlarmEditor

.

Using Progress Indicators

17

This section describes how to use the automatic busy cursor, the notify icon, the

DoProgress

function, and

protoStatusTemplate

views.

Using the Automatic Busy Cursor

17

Your application need not do anything extra to support the busy cursor; it
is displayed automatically when the system is temporarily unavailable for user
input. If you want the busy cursor to appear, or to suppress it’s appearance, you
may call the

ShowBusyBox

function. This global function takes one parameter,

showIt

, which is a Boolean that determines whether the busy cursor is shown.

Using the Notify Icon

17

To report progress to the user, most applications display a status slip based on

protoStatusTemplate

. Normally, this slip includes a close box you can use to

hide the status slip and add an action to the notify icon. The action shows the status
slip again.

Note

Status views that use the

DoProgress

function are an exception

to this rule. Do not include a close box in these views.

The notify icon maintains a list of these actions. When the user taps the notify icon,
a pop-up menu of actions appears. Choosing an item from the menu invokes that
action and removes it.