effbot at telia.com
Sun Oct 8 16:15:14 CEST 2000
> I would like to display image files onto labels and canvasses. I noticed
> however, that if I call PhotoImage from within a function, no image will
> appear. When I run the following code, a photo appears on the label but
> not the canvas, even though the lines and bitmap do appear. Is this a
> Tkinter bug? Is there a workaround?
You must keep a reference to the photoimage object.
c = Tkinter.Canvas(f)
c.photo2 = Tkinter.PhotoImage(file="lena.gif")
for more info, see:
<!-- (the eff-bot guide to) the standard python library:
More information about the Python-list