home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-03-03 | 645 b | 30 lines | [TEXT/ttxt] |
- /*
-
- Copyright: © Apple Computer, Inc. 1993
- author: Mike Engber
-
- WakeUpAndGoToSleep v1
-
- This sample demos how to detect when the Newton wakes up. The basic idea is
- to spawn a deferred action right before the Newton goes to sleep. The
- action runs when the Newton wakes up.
-
- This sample replaces WakeUpTimeToDie which used a more complex method
- involving idle scripts.
-
-
- */
-
-
- constant kAppSymbol := '|WakeUpAndGoToSleep:PIEDTS|;
-
- InstallScript := func(partFrame)
- begin
- AddDeferredAction(func() AddPowerOffHandler(GetRoot().(kAppSymbol)),[]);
- end;
-
- RemoveScript := func(partFrame)
- begin
- RemovePowerOffHandler(GetRoot().(kAppSymbol))
- end;
-