472,127 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

Double Click Mouse Event in Tkinter

Creating a Windows application:
<Double-Button-1> mouse event has a conflict when there is also a
binding to the <Button-1> event. It seems like a silly oversight that
performing a double click will also initiate the single click action.

Has anyone figured out a way to circumvent this problem? Right now I am
making the Double click function undo the action my Single click
function does, but this is very annoying, especially since the action
that is bound to the Single click flashes for a second.

Jan 7 '06 #1
1 4987
"scott_gui" wrote:
Creating a Windows application:
<Double-Button-1> mouse event has a conflict when there is also a
binding to the <Button-1> event. It seems like a silly oversight that
performing a double click will also initiate the single click action.
If your design depends on your code being able to accurately figure out what
the user will do in the future, you may want to go back to the drawing board.
Has anyone figured out a way to circumvent this problem? Right now I am
making the Double click function undo the action my Single click
function does, but this is very annoying, especially since the action
that is bound to the Single click flashes for a second.


I don't think I've ever seen any recent application that does this (be-
cause all possible "solutions" are annoying), but I seem to recall that
the Explorer in some early version of Windows overloaded single and
double click actions by delaying the single click action (click and wait =
single click action, click and click = double click action).

To implement this in Tkinter, you can schedule an "after" task in the
Button-1 handler, and cancel it in the Double-Button-1 handler. But
a redesign is probably a better idea...

</F>

Jan 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by eltronic | last post: by
2 posts views Thread by scott_gui | last post: by
1 post views Thread by Tuvas | last post: by
9 posts views Thread by Armando | last post: by
reply views Thread by Paul DeWitt | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.