help:problem using the RawPen class/turtle module.

Lee Harr missive at frontiernet.net
Sun Apr 7 17:23:45 EDT 2002


> I think I've found the problem,
> it seems that the call to 
> 
> ...
> self._arrow = _canvas.create_line(x-dx,y+dy,x,y,
>                                   width=self._width,
>                                   arrow="last",
>                                   capstyle="round",
>                                   fill=self._color)
> 
> ...
> 
> in the turtle.py ( _draw_turtle() method)
> doesn't work because the _canvas to refer to is
> the one in the 'self' instance,  
> so with the following change:
> 
> self._arrow = self._canvas.create_line(x-dx,y+dy,x,y,....
>               ^^^^^
> 
> everything is ok.
> 
> Without it the _canvas refers to a global that it
> isn't been initialized to a Canvas when there is a
> call to the RawPen class.
> 


Nice work.

In the version I have, that line does not exist, but all of
the calls to things like _canvas_create_*
are called as self._canvas_create_*
so you may have uncovered a bug.

I think the turtle module is not really used very much,
though I think it is pretty cool.

Please file a bug report!




More information about the Python-list mailing list