Tk Library Source Code

View Ticket
Login
Ticket UUID: 781652
Title: Selection display bug in BWidgets Listbox
Type: Bug Version: None
Submitter: sgamon Created on: 2003-08-01 18:21:39
Subsystem: bwidget Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2003-08-07 06:36:06
Resolution: Fixed Closed By: hobbs
    Closed on: 2003-08-06 23:36:06
Description:
When using a BWidgets Listbox, clicking on an item
selects it, and highlights the text (that's normal). 
However, clicking on other items does not remove the
highlights from previous selections.  It is quickly
possible to fill the listbox
with apparently selected items.  Very confusing.

The problem is located in ListBox::_redraw_selection:

            set id [eval [list $path.c create
rectangle] $bbox \
      [list -fill $selbg -outline $selbg \
      -tags [list [list sel s:$item]]]]

This is one [list] too many. Changing this line to:

            set id [eval [list $path.c create
rectangle] $bbox \
      [list -fill $selbg -outline $selbg \
      -tags [list sel s:$item]]]

solves the problem.
User Comments: hobbs added on 2003-08-07 06:36:06:
Logged In: YES 
user_id=72656

The whole eval isn't necessary in Tk 8.3+.  Corrected for post-
1.6.