Posted to tcl by Siqsuruq at Sat Sep 21 15:52:48 GMT 2013view raw

  1. # Updating ttk::label variable, countdown
  2. proc start_count {min} {
  3.  
  4. set sec [expr $min * 60]
  5. set ::countdown $sec
  6. every 1000 {set ::countdown [expr $::countdown - 1]; if {$::countdown -1 < 0} return}
  7.  
  8. }
  9.  
  10. proc test_start {} {
  11. set rounds [list 1 2 3 4 5 6]
  12.  
  13. foreach round $rounds {
  14. # Need to wait here till label got 0
  15. start_count 1
  16. # Next round
  17. puts $round
  18. }
  19. }