global Imgdly Src waitcnt waiting waitchr waitchrs waitchrn waitstyle set waitcnt 0; # Keeps track of current wait loop. set waiting 0; # Whether we are waiting right now. set waitchr * set waitchrs {/ - \\ | /} set waitchrn 0 set waitstyle 1 ;# 0: steady spin; 1: when input # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Start a wait loop. This produces the little "spinning line" effect in the # # .bWheel button. 100 ms seems to be about the right speed. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # proc Waiting {} { global V me waitcnt waiting waitstyle set waiting 1 incr waitcnt if {$waitstyle>0} {after 100 WaitTick $waitcnt} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # proc WaitDone c { global waitchr waiting set waiting 0 set waitchr $c } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # proc Tick {} { global waitchr waitchrs waitchrn set waitchrn [expr ($waitchrn+1)%4] set waitchr [lindex $waitchrs $waitchrn] } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # proc WaitTick {n} { global waitcnt waiting waitstyle if {$n != $waitcnt} {return} if !$waiting {return} Tick if {$waitstyle>0} {after 100 WaitTick $n} }