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: dashboard activation events and timers.



Just record the time every time you do your update.  The next time the your
onshow is called and the necessary time has passed, do the update
immediately and set the timer.

Thanks,
jl

> Hello all, I have a question regarding timers and activations events. This
> code is take from the dashboard programming guide:
> http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboar
> d_Tutorial/index.html
> When Dashboard is shown, onshow is called. This function sets a timer in
> motion:
> 
> 
> function onshow () {
> 
>     if (timer == null) {
> 
>         updateTime();
> 
>         timer = setInterval("updateTime();", 1000);
> 
>     }
> 
> }
> 
> 
> 
> When Dashboard is hidden, onhide halts the timer:
> 
> 
> function onhide () {
> 
>     if (timer != null) {
> 
>         clearInterval(timer);
> 
>         timer = null;
> 
>     }
> 
> }
> 
> 
> I have gotten this working fine with no problems, however my question is more
> of a conceptual one.
> 
> For example: If I have a timer that is supposed to update my widget every hour
> or half and hour, then unless the dashboard is active for that amount of time,
> my update will  never occur.
> i.e. the interval is set to 360000 (1 hour) when the dashboard is activated,
> however if the dashboard is then deactivated before the hour is up, then my
> timer is cleared and the update doesn't happen.
> 
> perhaps someone can shed some light on this concept for me,
> Thanks,
> Micah Acinapura
> email@hidden
> 
> 
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Dashboard-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/dashboard-dev/email@hidden
> 
> This email sent to email@hidden


--------------------------------------------------
John Louch         Internet #: email@hidden
(805) 541 2965


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden

References: 
 >dashboard activation events and timers. (From: Micah Acinapura <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.