
update doesn't seem to work with scale
Hello,
In the following example I'm trying to get a scale to run a command without
slowing down the slider motion. I'm using update within the command's loop,
and using a global variable to prevent more than one instance of the command
from running at a time, but the slider still freezes up. Does anyone know
why, and how I can get around it? BTW I'm using tcl8.2 and I've tried in on
Windows98 and HPUX.
thanks in advance.
# create and pack scale
scale .s -command {command1}
pack .s -fill y
#diagnostic output file
set output [open output.txt w]
set working N
proc command1 {args} {
global working j output
if {$working} {
# already working, so don't do anything
puts $output "already working"
} else {
set working Y
# do something in a loop
for {set j 0} {$j < 1000} {incr j} {
puts $output "working, $j"
update
}
set working N
}
Quote:
}
.