#!/usr/bin/wish
set aa 0
for {set i 1} {$i < 5} {incr i} {
set bt [button .$i -text $i]
bind $bt <Button-1> {
incr aa
$bt configure -text $aa
update
}
}
when I press button .1 .2 .3 .4 , only button .4 text change. why this happen ? and how to make button text change separately?
set aa 0
for {set i 1} {$i < 5} {incr i} {
set bt [button .$i -text $i]
bind $bt <Button-1> {
incr aa
$bt configure -text $aa
update
}
}
when I press button .1 .2 .3 .4 , only button .4 text change. why this happen ? and how to make button text change separately?