Tkinter buttons with image ?

Axel Kowald kowald at molgen.mpg.de
Mon Aug 16 17:59:56 CEST 2004


> Using the image in Tkinter will not keep it from being garbage-collected.
> You need to keep a reference to the image, either in a global variable or
> like so:
> 
> buttonStart = Button(frameWb, image=tmp, command=root.quit)
> buttonStart.image = tmp

Ah, that's the trick.

Many thanks,

              Axel



More information about the Python-list mailing list