TKinter PhotoImage Class?? - 2nd round

Fredrik Lundh fredrik at
Tue Oct 16 08:33:40 CEST 2001

Robert C. Ramsdell wrote:
> When I try the method above in the method, the Canvas remains empty.
> No errror message is given, the image just is not displayed.  Does anyone
> know why this is happening?

you must keep a reference to the PhotoImage object.  see
FAQ question 4.69 for a bit more information:

>         def draw_image(self, iname):
>                 self.drawspace.pack()
>                 i=PIL.ImageTk.PhotoImage(file=iname)

        = i

>                 self.drawspace.create_image(0,0,image=i)


<!-- (the eff-bot guide to) the python standard library:

More information about the Python-list mailing list