Posted to junk by kostix at Thu Nov 30 11:26:22 GMT 2006view raw

  1. #! /usr/bin/wish
  2.  
  3. package require Tk
  4.  
  5. foreach x {start stop} {
  6. pack [button .$x -text $x -command $x] -side left
  7. }
  8.  
  9. proc start {} {
  10. global id env
  11.  
  12. exec [file join $env(windir) system32 notepad.exe] &
  13. set id [after 3000 start]
  14. }
  15.  
  16. proc stop {} {
  17. global id
  18.  
  19. after cancel $id
  20. }