rubberscissors
Technical User
Using Tk, I've created a series of buttons for a series of slots, and I've grouped the buttons into groups of 2. These buttons are packaged in frames as in the example below:
frame .slot1and2
button .slot1and2.slot1board1
Later, I call up a proceedure to cycle through different board types, and I pass values indicating slot group and slot depending on the button being clicked and I want to assign variables to the numbers in the frame/button names:
proc cycle { s1 s2 s3 } {
pack forget .slot$s1and$s2.slot$s3board1
}
The example above obviously doesn't work, but I've tried:
pack forget .slot{$s1}and{$s2}.slot{$s3}board1
and
pack forget .slot$s1\and$s2\.slot$s3\board1
The example with the slashes seems to come closest to working, but I get an error complaining that the path:
.slot1|nd2.slot1board1
is a bad path - the 'a' in 'and' gets converted to a garbage character...I changed the 'a' to another letter, thinking \a may be a special character...I changed it to 'f' but it still gives me an error. Does anyone know the correct syntax?
frame .slot1and2
button .slot1and2.slot1board1
Later, I call up a proceedure to cycle through different board types, and I pass values indicating slot group and slot depending on the button being clicked and I want to assign variables to the numbers in the frame/button names:
proc cycle { s1 s2 s3 } {
pack forget .slot$s1and$s2.slot$s3board1
}
The example above obviously doesn't work, but I've tried:
pack forget .slot{$s1}and{$s2}.slot{$s3}board1
and
pack forget .slot$s1\and$s2\.slot$s3\board1
The example with the slashes seems to come closest to working, but I get an error complaining that the path:
.slot1|nd2.slot1board1
is a bad path - the 'a' in 'and' gets converted to a garbage character...I changed the 'a' to another letter, thinking \a may be a special character...I changed it to 'f' but it still gives me an error. Does anyone know the correct syntax?