hi.... i'm trying to write a function clear image but i am not being able to write it.
it is as follows. i am loading a picture and i want by clicking the button clear, the picture map.gif dis appear..
there is a function blank in tkinter but i am not being able to use it well to perform this.
can anyone tell me how to do it?????
thanx
import Tkinter
from Tkconstants import *
def window(tk):
global photo
frame=Tkinter.Frame(tk)
frame.pack()
canvas=Tkinter.Canvas(frame,bg ='white', width=500,height=500)
canvas.pack()
obj1 = canvas.create_text(250, 10, text='Simulation ',font=('verdana', 16, 'bold'))
button=Tkinter.Button(frame, fg ="blue",text="Clear",activebackground='red',command=clear).pack(side =LEFT, padx=20)
photo=Tkinter.PhotoImage(file="map.gif")
canvas.create_image(200, 250, image=photo)
def clear():
# can anyone tell me how to write the function clear image
root = Tkinter.Tk()
root.title("Simulation")
window(root)
root.mainloop()