Interrupting a procedure

From: Phil Biehl (fylbeall_at_yahoo.com)
Date: 12/23/04

  • Next message: Quokka: "Re: Interrupting a procedure"
    Date: Wed, 22 Dec 2004 16:23:09 -0800
    
    

    I have a procedure that flashes a button and updates the button text at 1
    sec intervals. I'd like to be able to interrupt and end this proccedure from
    another procedure. How can I do this?

    Thanks,
    Phil

    proc DoSMTimer {} {
        proc toggle {v} {uplevel [concat set $v \[expr \[set $v\] ^ 1\]]}
        proc Sleep {time} {after $time set end 1; vwait end}

        set TogBit 0
        for {set i $::SMTime} {$i >= 0} {incr i -1} {
            if {[set TogBit [toggle TogBit]]} {set color #33ffff} else {set
    color #3333ff}
            .row5.spell configure -text "SpellMode in $i seconds" -background
    $color
            Sleep 1000
        }
        .row5.spell configure -text "Spell" -background #33ffff
    }


  • Next message: Quokka: "Re: Interrupting a procedure"
  • Quantcast