tkinter: canvas: error?

richard_chamberlain richard_chamberlain at ntlworld.com
Tue Jul 25 17:13:39 EDT 2000


Keith,

canvas.coords doesn't expect a tuple try:

canvas.coords(1,20,20,150,150)

instead,

Richard
Keith Murphy <kpmurphy at my-deja.com> wrote in message
news:8lkpp5$3qp$1 at nnrp1.deja.com...
> is this a bug?  ...or is it a feature :)
>
> bbox = (80, 80, 120, 120)
> canvas = Canvas()
> canvas.pack()
> canvas.create_rectangle(bbox, fill='black', tag='mybox')
> canvas.coords(1, bbox)
>
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
>   File "/usr/local/lib/python1.5/lib-tk/Tkinter.py", line 1205, in
> coords
>     self.tk.splitlist(
> TclError: wrong # coordinates: expected 0 or 4, got 1
>
> thanks,
> -->keith
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.





More information about the Python-list mailing list