Mailing Lists: Apple Mailing Lists

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

dashboard activation events and timers.



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/Dashboard_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



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.