Tk Source Code

View Ticket
Login
Ticket UUID: 1bddba50f88450b68d0e2ca85730a3cc5ad2ee09
Title: <Double-1> delivery difference between linux and windows
Type: Bug Version: 8.6.12
Submitter: pointsman Created on: 2022-04-21 18:52:36
Subsystem: 69. Events Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2022-07-19 23:15:18
Resolution: None Closed By: nobody
    Closed on:
Description:
# On linux the <Double-1> event will be delivered to the app (despite
# the <<ListboxSelect>> needs some time to return.) On windows (at
# least on my windows 10 box) no <Double-1> will be delivered to the
# app.

package require Tk

set data {one two tree}

proc listboxselect {args} {
    puts "listboxselect called"
    after 1500
    puts "listboxselect returns"
}

proc double {args} {
    puts "double called"
}

listbox .l -listvariable data
bind .l <<ListboxSelect>> listboxselect
bind .l <Double-1> double
pack .l
User Comments: pointsman added on 2022-07-19 23:15:18:
Sorry for the response delay.

It's not up to me to decide which behaviour will be blessed by the maintainer to be it.

The bug is the different behaviour on linux and windows (with mac in the windows box, as you write). This makes multi-plattform applications difficult. I stumbled over this because my code works linux but not on windows.

But, frankly, yes, if you ask me: The windows behaviour smells like eating up the Double-1 sillently; I'd prefer the linux behaviour.

fvogel added on 2022-07-17 13:33:45:

I can observe the following when double-clicking an item of the listbox:

  • Linux: <<ListboxSelect>> triggers immediately, and at the time proc listboxselect returns <Double-1> triggers
  • Windows and macOS: <<ListboxSelect>> triggers immediately, and at the time proc listboxselect returns, <<ListboxSelect>> triggers again

I understand that the expected behaviour for you is the Linux one, is this correct?