Ask Your Question
0

How to control window events properly?

asked 2013-05-15 23:03:19 -0500

Diego Aguilar gravatar image

I wrote the following code under Ubuntu 12.04, it works quite good, however whenever I left click on the window, even one simple click, it reacts way too good cause I let's say 500 lines with the Click izquierdo output... What's the best way to limit to only one printing per click?

from SimpleCV import Display, Image
import time


img = Image("/home/py_src/elephants.jpg")
window = img.show()

while not window.isDone():
    if window.mouseLeft:
            print "Click izquierdo"
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-05-15 23:14:34 -0500

Diego Aguilar gravatar image

Found and solved!

There's a difference between mouseLeft listens long for the mouse's left button and now I can think it has a miliseconds precision.

I solved it by using leftButtonUp, this does the right trick

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-05-15 23:03:19 -0500

Seen: 88 times

Last updated: May 15 '13