I have many checkboxes so I create them in a for statement:
set nck 0
foreach lf $lfiles {
checkbutton $tfl.ck_$nck -text $lf -variable vck_$nck
$tfl window create end -window $tfl.ck_$nck -align top
$tfl insert end \n
set nck [incr nck]
}
where tfl is a text widget
This actually works, but when I try to get the vars values
i get a small, but annoying problem. E.g. I try to print checkboxes vars values:
for (set i 0} {$i<$nck} {incr i} {
puts $vck_$i # this is wrong because now
# there are 2 vars: vck_ and i
}
I can't do this either:
set tempvar vck_$i
puts $tempvar
because tempvar's value is a kind of pointer.
Any idea how I could get vck_$i var value?
Or some other way I could declare a checkbutton variable..
Thanks in advance
set nck 0
foreach lf $lfiles {
checkbutton $tfl.ck_$nck -text $lf -variable vck_$nck
$tfl window create end -window $tfl.ck_$nck -align top
$tfl insert end \n
set nck [incr nck]
}
where tfl is a text widget
This actually works, but when I try to get the vars values
i get a small, but annoying problem. E.g. I try to print checkboxes vars values:
for (set i 0} {$i<$nck} {incr i} {
puts $vck_$i # this is wrong because now
# there are 2 vars: vck_ and i
}
I can't do this either:
set tempvar vck_$i
puts $tempvar
because tempvar's value is a kind of pointer.
Any idea how I could get vck_$i var value?
Or some other way I could declare a checkbutton variable..
Thanks in advance