changing icon of a Tkinter window

Chad Netzer cnetzer at mail.arc.nasa.gov
Thu Jun 5 17:06:44 EDT 2003


On Thu, 2003-06-05 at 13:49, Federico wrote:
> Please can someone give me an example on how to change the icon of a Tkinter
> window ? I use python 2.2.3 under mswindows...

Well, here is a piece of code from a program I wrote.

win.wm_iconbitmap( "@canvas_icon.xbm" )

where "win" is a widget, and 'canvas_icon.xbm' is a filename of an X
bitmap.

Back in the day, I look for a way of doing it with pipes, or file like
objects, etc. but no such luck.  Perhaps Tk has added some features
since then.  If you don't want permanent files, you could write
temporary files and delete them.


-- 

Chad Netzer
(any opinion expressed is my own and not NASA's or my employer's)






More information about the Python-list mailing list