Tk Library Source Code

View Ticket
Login
Ticket UUID: 710139
Title: BWidget 1.4.1 ListBox dropovercmd bugs
Type: Bug Version: None
Submitter: anhlephuoc Created on: 2003-03-26 16:24:53
Subsystem: bwidget Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2007-11-01 02:43:40
Resolution: Out of Date Closed By: hobbs
    Closed on: 2007-10-31 19:43:40
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} {
User Comments: hobbs added on 2007-11-01 02:43:40:
Logged In: YES 
user_id=72656
Originator: NO

looks fixed somewhere along the way