Description: |
## Example code
package require swaplist
toplevel .t
swaplist::swaplist .t.swl sels {a b c} {d e} -embed
pack .t.swl
## If you double click the left listbox, the error dialog is displayed.
# invalid command name ".t.lr.left"
# while executing
# "$top.lr.left invoke"
# (procedure "::swaplist::Double" line 6)
# invoked from within
# "::swaplist::Double .t.swl.list2.list"
# (command bound to event)
## Patch to this issue
172,173c172,173
< bind $w.list1.list <Double-Button-1> [list ::swaplist::Double %W]
< bind $w.list2.list <Double-Button-1> [list ::swaplist::Double %W]
---
> bind $w.list1.list <Double-Button-1> [list ::swaplist::Double $w 1]
> bind $w.list2.list <Double-Button-1> [list ::swaplist::Double $w 2]
350,356c350,355
< proc ::swaplist::Double {w} {
< set top [winfo toplevel $w]
< if {[string match *.list1.* $w]} {
< $top.lr.right invoke
< } elseif {[string match *.list2.* $w]} {
< $top.lr.left invoke
< }
---
> proc ::swaplist::Double {w side} {
> if {$side == 1} {
> $w.lr.right invoke
> } elseif {$side == 2} {
> $w.lr.left invoke
> }
|