Tk Source Code

View Ticket
Login
Ticket UUID: 3102228
Title: <<ListboxSelect>> Doesn't fire when selection lost
Type: Bug Version: obsolete: 8.5.9
Submitter: lewins Created on: 2010-11-03 13:52:27
Subsystem: 09. [listbox] Assigned To: fvogel
Priority: 6 Severity: Minor
Status: Closed Last Modified: 2016-01-06 20:32:47
Resolution: Fixed Closed By: fvogel
    Closed on: 2016-01-06 20:32:47
Description:
Assuming that the selection state of a listbox reflects the physical state of a system, then <<ListboxSelect>> should fire whenever the selection state of the listbox changes. This happens for mouse clicks in the listbox, but not when the listbox loses the selection. Consider the following script. If one or more entries in the listbox are selected, then clicking "take" removes the selection (the entries are no longer highlighted). However, the bound "puts" doesn't fire to indicate this change in state.

listbox .l
.l insert 0 1 2 3
pack .l
button .b -text "take" -command {selection own .b}
pack .b
bind .l <<ListboxSelect>> {puts [selection get]}
User Comments: fvogel added on 2016-01-06 20:32:47:
Fix pushed in core-8-5-branch and trunk.

fvogel added on 2015-12-31 13:52:40:
Fix proposed in branch bug-3102228fff, with new test case added.