Code: Select all
proc lremove { list string } {
return [lsearch -all -inline -not -exact $listname $string]
}
Code: Select all
set timer 0
foreach element $list_of_ tasks {
set timer [expr $timer + 5]
set id [utimer $timer [list $element]]
lappend ::list_with_timerids $id
}
Code: Select all
foreach id $::list_with_timerids {
killutimer $id
}
I don`t want to use catch because some other utimer (set by another script) could have that id now and I could eventually kill the wrong timer because he has the same name.
The problem is set id [utimer $timer [list $element]]. I would like to expand the [list ...] section with a command to remove the utimer from $::list_with_timerids. With set :list_with_timerids [lremove $:list_with_timerids $id].
But this isn`t possible because I get the $id just after I did set the utimer. Is there some tricky work around?
As far I know I can not modify a timer/utimer/after after it has been set. Otherwise it would be easy.