Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimers and sleeping mac's



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >NSTimers and sleeping mac's (From: Aaron Wallis <email@hidden>)
 >Re: NSTimers and sleeping mac's (From: "Sean McBride" <email@hidden>)
 >Re: NSTimers and sleeping mac's (From: Keith Duncan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.