I have a GUI where I bind two events to a label like this:
self.label.bind('<Button-1>', self.single)
self.label.bind('<Double-1>', self.double)
the problem is that, even if I double click the label, the 'double' function isn't called, and the 'single' function is called twice.
It looks like the single click event is blocking the double click event as, if I remove the single click event line, I can normally call the 'double' function.
I read the docs and from what I got it should catch both events, but this is not the case.
Anyway, I tried this simple script and it catches both events
from tkinter import *
def single(event):
print('single click')
def double(event):
print('double click')
widget = Button(None, text='Hello event world')
widget.pack()
widget.bind('<Button-1>', single)
widget.bind('<Double-1>', double)
widget.mainloop()
Then I don't understand why it doesn't work in the first script. I can post the entire file if needed. Thank you :)
Original File: https://github.com/matte980/ExplorerFile/blob/main/ObjectsPublish.py
question from:
https://stackoverflow.com/questions/65944956/single-click-blocks-double-click-in-tkinter 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…