Changing the Image on a button
odeits at gmail.com
Mon Feb 16 02:18:50 EST 2009
I want to be able to toggle if the button has an image or text. For
some reason the following code gets the button to have an image but
when i push the button i expect the image to go away but it does not.
Am I missing something?
from Tkinter import *
btn.configure(image = None)
root = Tk()
img1 = PhotoImage(file="bacon.gif")
btn = Button(image = img1, command = do, text = "hello" )
btn.img = img1
More information about the Python-list