Adding Icon To Tkinter Window

Serhiy Storchaka storchaka at gmail.com
Sat Mar 5 14:55:40 EST 2016


On 05.03.16 18:47, Wildman via Python-list wrote:
> Anybody have the correct method of adding an icon to a
> window?  I have found several code examples on the web
> but they all result in an error.  Thanks.

On Windows:

     root.wm_iconbitmap(default='myapp.ico')

.ico-file can contain several icons of different size.

Otherwise if TkVersion >= 8.5:

     root.wm_iconphoto(True, PhotoImage(file='myapp16.gif'),
                             PhotoImage(file='myapp32.gif'), ...)

You can specify several icons of different size.

If TkVersion >= 8.5 you can use .png-files.





More information about the Python-list mailing list