[Edu-sig] Problem with mouse clicks

Peter Drake drake at lclark.edu
Mon Feb 19 21:13:11 CET 2007

I just had my students write this program in my CS0 class:

from graphics import *

while 0 < 1:
     click = mouse()
     x = click[0]
     y = click[1]
     oval([x-10, y-10], [x+10, y+10])

(Note that graphics is Zelle's version with my procedural wrappers  
appended, http://www.lclark.edu/~drake/courses/cs0/graphics.py)

Usually (but, frustratingly, not every run), the mouse clicks are  
offset, so the circles appear some distance above and to the left of  
where they should.

Has anyone else run into this? Is there an explanation or workaround?

Peter Drake

More information about the Edu-sig mailing list