Tk Library Source Code

View Ticket
Login
Ticket UUID: 3000293
Title: ListBox bindText <Button-1> stops selection
Type: Bug Version: None
Submitter: oehhar Created on: 2010-05-12 06:25:57
Subsystem: bwidget Assigned To: oehhar
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2010-05-12 15:46:21
Resolution: Fixed Closed By: oehhar
    Closed on: 2010-05-12 07:17:47
Description:
Given a Listbox with the patch of bug 2995969 (which uses ButtonRelease events instead Button for selection) and the following script:
pack [ListBox .l -selectmode single]
.l insert end list:#auto -text 111
.l insert end list:#auto -text 222
.l insert end list:#auto -text 333
.t.l configure -width 10
proc p {args} {puts "p $args"}
ListBox::bindTag .t.l <Button-1> p
---
After the bindTag command, selection will not work any more.
User Comments: danckaert added on 2010-05-12 15:46:21:
It is not surprising that bindText <Button-1> does not work, since there is already a binding for <Button-1>.
The normal workaround is to add a "+" to the binding:

.l bindText <Button-1> +p

That solves the issue for me.

oehhar added on 2010-05-12 14:18:41:
... as the last two bugs, this was also reported by Robert Karen, thank you !

oehhar added on 2010-05-12 14:17:47:
The issue was, that bindText/bindImage mathods interfere with the internal selection bindings.
The attached patch decouples the bindings.
The Patch runs against release 1.9.0. The patch of Bug 2995969 is also included.
It concerns some identical lines and they would be exclusive otherwise.

oehhar added on 2010-05-12 14:15:13:

File Added - 373621: listbox-1.9.0.diff3

oehhar added on 2010-05-12 13:30:23:
Sorry, it is bindText, not bindTag:
- Script -
pack [ListBox .l -selectmode single]
.l insert end list:#auto -text 111
.l insert end list:#auto -text 222
.l insert end list:#auto -text 333
.l configure -width 10
proc p {args} {puts "p $args"}
.l bindText <Button-1> p
- End -
After the binText method invocation, mouse selection will not work any more.

Attachments: