Apple Newton Utilities User's Guide Page 627

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 626
CHAPTER 17
Additional System Services
Using Additional System Services 17-11
Using Alerts and Alarms 17
This section describes the use of functions and methods that provide alerts and
alarms, and the
protoPeriodicAlarmEditor.
Using the Notify Method to Display User Alerts 17
The Notify method offers a simple way to display a message to the user. This
method takes three arguments. The rst species which type of alert is displayed;
some alerts beep, some only log their notice instead of displaying it, and so on. The
other two arguments are strings shown to the user in the alert.
The following code fragment creates the slip shown in Figure 17-7:
:Notify(kNotifyAlert,"LlamaCalc",
"You’ve run out of Llamas!");
Figure 17-7 A user alert
Creating Alarms 17
The AddAlarm and AddAlarmInSeconds functions are used to schedule a new
alarm. You can also use these functions to substitute a new alarm for one that is
currently scheduled but has not yet executed.
The
AddAlarm function creates each new alarm as a soup entry (thus, alarms
persist across restarts) and returns an alarm key that uniquely identies the new
alarm. This alarm key is a string you provide as one of the arguments to the
function that creates the alarm; it includes your developer signature as a sufx. For
example, a typical alarm key might be the string
"lunch:myApp:mySig" or
something similar. Note that only the rst 24 characters of an alarm key are
signicant.
IMPORTANT
Do not manipulate the alarm soup or its entries directly. Use only
the interface described in this chapter to manipulate alarms.
Page view 626
1 2 ... 622 623 624 625 626 627 628 629 630 631 632 ... 941 942

Comments to this Manuals

No comments