Posted By

ringo on 07/16/06


Tagged

onshow onhide dashboard widget


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

fantomex


dashboard widget minimal event init


 / Published in: JavaScript
 

http://developer.apple.com/jp/documentation/AppleApplications/Conceptual/DashboardTutorial/index.html?http://developer.apple.com/jp/documentation/AppleApplications/Conceptual/DashboardTutorial/Events/chapter6section_3.html

  1. if (window.widget)
  2. {
  3. widget.onshow = onshow;
  4. widget.onhide = onhide;
  5. }
  6.  
  7. function onshow () {
  8. if (timer == null) {
  9. updateTime();
  10. timer = setInterval("updateTime();", 1000);
  11. }
  12. }
  13.  
  14. function onhide () {
  15. if (timer != null) {
  16. clearInterval(timer);
  17. timer = null;
  18. }
  19. }

Report this snippet  

You need to login to post a comment.