Unusable outer edge of Tkinter canvases?

Dave Opstad dave.opstad at monotypeimaging.com
Wed May 25 13:11:30 EDT 2005


In article <mailman.98.1117037929.18027.python-list at python.org>,
 "Fredrik Lundh" <fredrik at pythonware.com> wrote:

> to fix this, you can either set the border width to zero, add scrollbars
> to the widget (this fixes the coordinate system), or explicitly reset the
> coordinate system:
> 
>     w.xview_moveto(0)
>     w.yview_moveto(0)

The canvas's border width was already zero, but when I moved the origin 
to (0,0) via xview_moveto and yview_moveto I was able to successfully 
draw all three rectangles.

Just out of curiosity, why aren't these zeroed to start with when the 
widget is created, given the default border width is zero? And is there 
a way of determining what they're set at, something like a xview_get() 
method? I looked at all the canvas's attributes (calling configure()) 
but nothing in there referred to xview or yview.

Thanks for the help!
Dave



More information about the Python-list mailing list