/* 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. */ InstallScript := func(partFrame) begin AddDeferredAction(func() AddPowerOffHandler(GetRoot().(kAppSymbol)),[]); end; RemoveScript := func(partFrame) begin RemovePowerOffHandler(GetRoot().(kAppSymbol)) end;