home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Practical Programming in Tcl & Tk (4th Edition)
/
TCLBOOK4.BIN
/
pc
/
exsource.old
/
44_3.tcl
< prev
next >
Wrap
Text File
|
2003-04-15
|
412b
|
21 lines
#
# Example 44-3
# Related listboxes are configured to select items together.
#
foreach l [list $frame.key $frame.cmd] {
bind $l <Button-1> \
[list BindSelect %y $frame.key $frame.cmd]
bind $l <B1-Motion> \
[list BindSelect %y $frame.key $frame.cmd]
}
proc BindSelect { y args } {
foreach w $args {
$w select clear 0 end
$w select anchor [$w nearest $y]
$w select set anchor [$w nearest $y]
}
}