Re: How to get path?



On May 16, 11:35 pm, ZB <zbREMOVE_THIS@xxxxxxxxxxxxxxxxxxxx> wrote:
Dnia 16.05.2008 Aric Bills <aric.bi...@xxxxxxxxx> napisa³/a:

Let's say, list elements are just 1 and 0, and clicking on the button
changes 0 to 1 (and the opposite). The most natural way to recognize the
list postion (I mean: which element to set/clear), would be to recognize
the widget path (f.e. ".buttons.switch2" - for the third button).

What about:

foreach i {1 2 3 4 5} {
pack [button .buttons.switch$i -text ... -command [list callback
$i]]
}

?

-Alex
.