Re: NSTimers and sleeping mac's
Re: NSTimers and sleeping mac's
- Subject: Re: NSTimers and sleeping mac's
- From: "Sean McBride" <email@hidden>
- Date: Sat, 28 Jul 2007 15:51:00 -0400
Keith Duncan (email@hidden) on 2007-07-27 12:10 said:
>I was aware of having to register for sleep/wake notifications but not
>the change in time ones. Where can you register for these
>notifications? I couldn't find them in NSWorkspace where I would've
>expected them.
I don't think there's any way with Cocoa notifications, but you can with
Carbon Events. Here's a snippit:
EventTypeSpec eventType;
eventType.eventClass = kEventClassSystem;
eventType.eventKind = kEventSystemTimeDateChanged;
EventHandlerUPP eventHandlerUPP =
NewEventHandlerUPP(DateChangeEventHandler);
EventHandlerRef eventHandlerRef = NULL;
(void)InstallApplicationEventHandler(
eventHandlerUPP,
1,
&eventType,
self,
&eventHandlerRef);
Sean
--
"But if the answer isn't violence, neither is your silence" - Pop Will
Eat Itself
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden