set counter 0 set counterID -1 label .l -textvariable counter frame .f button .f.start -text "Start!" -command countUp button .f.stop -text "Stop!" -command stopCounting pack .f.start .f.stop -side left -expand y -fill both pack .l -side top -fill x pack .f -side top -fill both -expand y proc countUp {} { global counterID counter incr counter set counterID [after 1000 countUp] } proc stopCounting {} { global counterID after cancel $counterID }