[Edu-sig] mouse input in turtle module

Brian Blais bblais at bryant.edu
Wed Feb 3 23:57:55 CET 2010


Hello,

I would like to find a way to pause, and get mouse input in the  
turtle module.  Since it is built on tk, I thought perhaps there  
would be an easy way, but I am stumped.  Specifically, I'd like  
something like:

x,y,button=mouse_input() # pause in here until the mouse is clicked  
in the turtle window

I know about the screenclick, where I can define a callback but I  
couldn't rig it to pause until a mouse clicked, even using global  
flags.  Is there an example of this somewhere?  For a bonus, I'd love  
to be able to <esc> out of it, either raising an exception or return  
a button=-1 or something.


thanks,

		Brian Blais

-- 
Brian Blais
bblais at bryant.edu
http://web.bryant.edu/~bblais
http://bblais.blogspot.com/



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20100203/be8370fc/attachment.htm>


More information about the Edu-sig mailing list