tkinter canvas tag stuff

Tuvas tuvas21 at gmail.com
Fri Dec 16 14:02:42 EST 2005


I'm trying to display a picture on a Tkinter Canvas. It seems to work
fine the first time that it is displayed. However, subsequent times
running shows an error like this:

TCLerror: Wrong # args: should be ".-1211472948 .-1211470996 addtag tag
searchCommand ?arg arg ...?

My code works like this:

if (pic):
     canvas.delete(pic)
im=Image.open(path)
image=ImageTk.PhotoImage(im)
pic=canvas.create_image(1,1,anchor="nw", image=image)
canvas.addtag(pic)


Note that path is a path selected outside of the function. What happens
is the image is displayed, but with the error message. I think I should
either have to put in some kind of argument into the addtag, which
isn't documented well, or use a similar but different function. Thanks
for the help!




More information about the Python-list mailing list