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 *


def do():
    btn.configure(image = None)

root = Tk()
img1 = PhotoImage(file="bacon.gif")

btn = Button(image = img1, command = do, text = "hello" )
btn.img = img1
btn.pack()
root.mainloop()
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to