Re: Sleep Notification?
Re: Sleep Notification?
- Subject: Re: Sleep Notification?
- From: John Timmer <email@hidden>
- Date: Tue, 26 Aug 2003 23:00:58 -0400
>
On Tuesday, August 26, 2003, at 07:01 PM, Andreas Mayer wrote:
>
> Am Mittwoch, 27.08.03 um 01:57 Uhr schrieb email@hidden:
>
>> Is there any notification that can notify an app that the computer is
>
>> about to go to sleep?
>
>
>
> Not yet. You will have to wait for Panther.
>
>
You _CAN_ do it in Jaguar, though. Check out the RegisterForSleep
>
Cocoa example code provided with the OS X PM (Power Management) SDK.
>
Go download the SDK, and you should be able to get it working on Jaguar
>
(or even 10.1 for that matter) pretty quickly...you can get
>
notification of (1) about to go to sleep, (2) just woke up, and (3) you
>
can say yes/no to "can system go to sleep" so as to prevent sleep from
>
happening. The third can be nice if you want to finish something that
>
can't or shouldn't be interrupted.
I've already got this wrapped in a pretty simple class that allows you to
register objects for receiving notifications, provided they implement an
appropriate method. I can send you the code if you'd like, but, since I'm
using it, I can't have it re-released under GPL, or under a commercial
license without some sort of agreement.
Let me know if you'd like to take a look.
JT
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.