All you now need is to write the procedure reJig, the script of which is given below:
proc reJig { w a} {
global aList vList
;# get the index of a in aList
set idx [lsearch $aList $a]
set va [.rc.fff.sub$idx.ent get]
.rc.b config $a $va
}
The proc command creates the Tcl procedure reJig. The first argument to reJig is a widget name and the second a string (in this case the configure option). The statements within the curly braces is the body of the procedure. ;# indicate that the string enclosed between them and the newline character is a comment.
The screen dump below shows the result of typing Red