C H A P T E R 1 7
Additional System Services
Using Additional System Services
The code above shows the two ways in which your code can respond when the user
cancels the operation. If the user taps the Stop button an exception is thrown by
. You may catch this exception and perform any clean-up necessary.
(In the code above the all-inclusive
clause catches this
exception.) You must, however, rethrow this exception so the system can perform
its own cleanup, otherwise the Newton device appears to hang. You must ensure
that any exceptions you do not specifically anticipate are rethrown by your
You may also perform any necessary housecleaning after an uncompleted operation
by comparing the result of the
function. If the user tapped the Stop
returns the symbol
Using DoProgress or Creating Your Own protoStatusTemplate
function creates a view based on the
to report progress to the user. Using this function is the simplest way to create a
view. However, it is not suitable for all applications.
You should use
Your code is structured synchronously; that is,
does not return
until the workFunc function has completed or the user cancels the operation.
The built-in bar gauge or barber pole status slips which
suitable for your needs.
The action is modal; that is, the user cannot do anything until the action finishes
or is canceled.
If any of these is not true, use
; that is you should create
Your code is structured asynchronously; that is, it allows user events to be
Your code uses communications; these usually have asynchronous components.
Your code requires a custom status template type; possibly for a transport.
Your actions are not modal; that is, the user could proceed in your application or
other applications while the action is in progress.
Using protoStatusTemplate Views
You need to take the following steps to use a
report progress to the user:
1. Specify the components of the status slip and their initial values. You can use
one of the system-supplied templates or create your own template.