tkinter event binding to mouse double click

June Kim junaftnoon at nospamplzyahoo.com
Tue Dec 19 03:51:46 EST 2000


I'm using Python 2.0 on Win32.
In the code following, the binding doesn't seem to work; it can't detect
mouse double-clicking at all. (Maybe a platform-specific problem, I reckon)


from Tkinter import *

root = Tk()

def callback(event):
    print "clicked at", event.x, event.y

frame = Frame(root, width=100, height=100)
frame.bind("<Double-Button-1>", callback)
frame.pack()

root.mainloop()




More information about the Python-list mailing list