I was looking at Removing the TK icon on a Tkinter window but when trying to duplicate the code I encountered an error. Below is the code and error
from Tkinter import *
import Image, ImageTk
import sys
def quit(self):
self.root.destroy()
root = Tk()
root.title("GUI program")
root.iconbitmap(default="C:\easy\Pics\ILC.ico")
im = Image.open("C:\easy\Pics\No-Image-Available.jpg")
image1 = ImageTk.PhotoImage(im)
# root has no image argument, so use a label as a panel
panel1 = Label(root, image=image1)
panel1.pack(side='top', fill='both', expand='yes')
root.mainloop()
Here is a copy of the error:
Traceback (most recent call last):
File "C:\easy\python\IPcam\test_image.py", line 11, in <module>
root.iconbitmap(default="C:\\easy\\Pics\\transparent.ico")
File "C:\Python25\lib\lib-tk\Tkinter.py", line 1524, in wm_iconbitmap
return self.tk.call('wm', 'iconbitmap', self._w, '-default', default)
TclError: bitmap "C:\easy\Pics\transparent.ico" not defined
I followed all of the steps. Any ideas?