Tk Library Source Code

View Ticket
Login
Ticket UUID: 792674
Title: ComboBox list size bug
Type: Bug Version: None
Submitter: nobody Created on: 2003-08-21 18:34:37
Subsystem: bwidget Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2003-08-22 01:53:31
Resolution: Works For Me Closed By: hobbs
    Closed on: 2003-08-21 18:53:31
Description:
When the script below is executed using BWidget-1.4.1,
it works fine.  However using BWidget-1.6.0 causes this
code to seg-fault.  To crash this code drop down the
list and select an item.  Then repeat.  When the list
is resized, thats all folks!  My debugging tells me
that there is memory usage problems in the Tk library.
 valgrind displays an 'invalid read of size 4'  So
there must have been a change somewhere in the current
BWidget version that brought out an old bug in Tk.  Or
I could be wrong.  Any Idea how to fix this?  

proc change_b { b } {
    set size [random 29]
    set vlist ""

    for {set i 0} {$i<$size} {incr i} {
lappend vlist [clock seconds]
    }
    $b configure -values $vlist
}

proc main { } {

    set width 200
    set height 200
    #    BWidget::place . $width $height center
    wm geom . ${width}x${height}
    wm deiconify .
    raise .
    focus -force .
    set rt [catch {set version [package require
BWidget]} err]

    if {$rt != 0} {
puts "error getting package BWidget"
return
    }

    set .b [ComboBox .b -modifycmd {change_b .b}]
    .b configure -values "Select an item"
    pack .b -side top
}

main
wm geom . [wm geom .]
User Comments: hobbs added on 2003-08-22 01:53:31:
Logged In: YES 
user_id=72656

Works just fine for me with ActiveTcl 8.4.4.0 release.