To set a two-color icon, use iconbitmap:
self.top.iconbitmap(myBitmap)
To give the icon a name other than the window’s title, use iconname:
self.top.iconname('Example')
You can give the window manager a hint about where you want to position the icon (however,
the window manager may place the icon in an iconbox if one is defined or wherever else
it wishes):
self.root.iconposition(10,200)
If you want a color bitmap, you must create a Label with an image and then use iconwindow:
self.label = Label(self, image=self.img)
self.root.iconwindow(self.label)
Partager