Apple Newton Utilities Guide de l'utilisateur Page 639

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 942
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 638
CHAPTER 17
Additional System Services
Using Additional System Services 17-23
And be sure to include this in your application’s ViewQuitScript to get rid of
the notify icon’s action:
if theNotifyIconAction then
begin
GetRoot().notifyIcon:KillAction(theNotifyIconAction);
theNotifyIconAction := nil;
end;
Opening the Status Slip 17
To instantiate a status slip view from its template, pass the template to the
BuildContext function, as shown in the following code fragment:
statusView := BuildContext(myStatusTemplate);
You should use only the BuildContext function to instantiate this template.
Next, you need to initialize the view. If your status view template provided an
initialSetup slot containing a setup frame, the system uses the frame in this
slot to perform this initialization automatically. Otherwise, you need to set some
initial values for the status view from within its
ViewSetupDoneScript
method. Pass the
ViewSet method a setup frame, as described in ViewSet in
Newton Programmers Reference.
Once the view has been initialized, send it the
Open message to display it, as in the
following code fragment:
statusView:Open();
Reporting Progress 17
Once your status slip is open you can perform the task on which you report
progress. You should structure the task to alternate between performing some work
and updating the status slip.
You can use the status slip’s
UpdateIndicator method to update the gauge
view only, as in the following example:
statusView:UpdateIndicator({values:{gauge: 50}});
To update other items in the status slip, you need to use the ViewSet method.
Although you can use the
ViewSet method to initialize all the status slip’s
components, you need not always pass all of these values. Once the status slip is
open you need only pass to this method the values to be changed.
statusView:ViewSet({
name: 'vGauge,
values: {statusText: "Waiting for host...",
gauge: 30} // 30% filled
});
Vue de la page 638
1 2 ... 634 635 636 637 638 639 640 641 642 643 644 ... 941 942

Commentaires sur ces manuels

Pas de commentaire