Re: drawing with the mouse with turtle

2015-02-10 Thread solarteclark
excuse me :) i know this somewhat disscussion was still on the past few years way back 2010 can i still ask about something? :) what syntax or coding will i use if i wanted to do multiple strokes of the mouse? because the [turtle.ondrag(turtle.goto)] that you have suggested have really helped

Re: drawing with the mouse with turtle

2010-11-13 Thread Brian Blais
On Nov 13, 2010, at 1:31 AM, Dennis Lee Bieber wrote: On Fri, 12 Nov 2010 20:48:34 -0500, Brian Blais bbl...@bryant.edu declaimed the following in gmane.comp.python.general: turtle.ondrag(turtle.goto) turtle.pendown() I'm not familiar with the turtle module but... would it make

Re: drawing with the mouse with turtle...solved?

2010-11-13 Thread Brian Blais
On Nov 12, 2010, at 8:48 PM, Brian Blais wrote: On Nov 12, 2010, at 8:05 PM, Steven D'Aprano wrote: On Fri, 12 Nov 2010 19:24:50 -0500, Brian Blais wrote: I'd like to draw on a turtle canvas, but use the mouse to direct the turtle. I don't see a good way of getting the mouse

Re: drawing with the mouse with turtle

2010-11-13 Thread Steven D'Aprano
On Sat, 13 Nov 2010 06:22:59 -0500, Brian Blais wrote: there is no change by changing the order, but I didn't expect one. since ondrag is binding a callback, which is only called when the event happens, I figure that the pen has to be down when the callback happens, not when the binding

Re: drawing with the mouse with turtle...solved?

2010-11-13 Thread Steven D'Aprano
On Sat, 13 Nov 2010 09:10:41 -0500, Brian Blais wrote: Here is code that works, with at least one small oddity: import turtle def gothere(event): turtle.penup() turtle.goto(event.x-360,340-event.y) turtle.pendown() def movearound(event):

drawing with the mouse with turtle

2010-11-12 Thread Brian Blais
I'd like to draw on a turtle canvas, but use the mouse to direct the turtle. I don't see a good way of getting the mouse coordinates and the button state. I tried to do something like this: import turtle def gothere(event): print event.x print event.y turtle.goto(event.x,event.y)

Re: drawing with the mouse with turtle

2010-11-12 Thread Steven D'Aprano
On Fri, 12 Nov 2010 19:24:50 -0500, Brian Blais wrote: I'd like to draw on a turtle canvas, but use the mouse to direct the turtle. I don't see a good way of getting the mouse coordinates and the button state. I think the right way to do that is by creating an event handler to the turtle.

Re: drawing with the mouse with turtle

2010-11-12 Thread Brian Blais
On Nov 12, 2010, at 8:05 PM, Steven D'Aprano wrote: On Fri, 12 Nov 2010 19:24:50 -0500, Brian Blais wrote: I'd like to draw on a turtle canvas, but use the mouse to direct the turtle. I don't see a good way of getting the mouse coordinates and the button state. I think the right way to