| Description: |
I encountered 2 bugs in the same proc ListBox::_over_cmd
1) The variable xs can escape intialisation in some case, causing runtime error.
Can be produced by dragging (slowly) an entry vertically from
a droppable area to a non-droppable area or reverse.
2) -dropovercmd command, get called back with a missing parameter $path
Below is a small context diff for the the changes:
$ diff -c listbox.tcl*
*** listbox.tcl Wed Mar 26 14:31:00 2003
--- listbox.tcl.orig Tue Aug 27 05:56:26 2002
***************
*** 1164,1170 ****
set yi [expr {$line*$dy}]
set ys [expr {$yi+$dy}]
set xi 0
- set xs $xi
set pos $line
if { [Widget::getoption $path -multicolumn] } {
set nrows $data(nrows)
--- 1164,1169 ----
***************
*** 1225,1231 ****
if { $vmode && [set cmd [Widget::getoption $path -dropovercmd]] != "" } {
# user-defined dropover command
! set res [uplevel \#0 $cmd [list $path $source $target $op $type $dnddata]]
set code [lindex $res 0]
set vmode 0
if {$code & 1} {
--- 1224,1230 ----
if { $vmode && [set cmd [Widget::getoption $path -dropovercmd]] != "" } {
# user-defined dropover command
! set res [uplevel \#0 $cmd [list $source $target $op $type $dnddata]]
set code [lindex $res 0]
set vmode 0
if {$code & 1} {
|