On the one hand, one has to understand that this is '''NOT''' possible to do successfully across all platforms and [window manager]s. There are just too many variations. Howev, here is something to attempt. Note that out of the box, Tk accepts only three image file formats - [GIF], [PGM], and [PPM]. If you want to use something other than that, take a look at [Img], which adds additional photo image types. ---- # Sample created by Larry W. Virden, with the kind assistance of # Donal K. Fellows # Date: Nov 6, 2002 package require Tcl package require Tk if { $argc != 1 } { puts stderr "$argv0 gif_pathname" exit } set icon_pathname [lindex $argv 0] set i [image create photo .i1 -format gif -file $icon_pathname ] set b [button .b1 -text hello] pack $b toplevel .icon;pack [label .icon.l -image $i] wm iconwindow . .icon ---- [Geoff Battye] mentions on [comp.lang.tcl] that the above code results in a color icon showing up on the desktop with [window manager]s like fvwm (and lv did the above work under cde). However, it didn't result in KDE showing a color icon in its title bar, alt-switching panel or its taskbar. So, [MGS] developed the code documented in [KDE window icons] to solve that need. ---- See also: * [wm iconwindow] ---- [Category Graphics] | [Category Porting]