example to change a Tkinter window's icon please

Federico maschio_77 at hotmail.com
Tue Jun 10 07:51:02 EDT 2003


I use python 2.2.3 under mswindows... each time I try to change the icon of
a tkinter window I have an error, I wrong something...

I try this:

import Tkinter
root=Tkinter.Tk()
bit=Tkinter.PhotoImage(file='logo1.gif',format='gif')
lb=Tkinter.Label(None,image=bit)
lb.grid()
root.iconwindow(lb)
root.mainloop()

and the error is : can't use .9563392 as icon window: not at top level

Please can someone give me a complete example on how to change a window icon
with iconwindow or iconbitmap or iconmask methods?
Thanks










More information about the Python-list mailing list