package require Tk
package require ico 0.3
pack [frame .f] -fill x
pack [button .f.b -text ... -command select] -side right
pack [entry .f.e -textvariable filename -width 60] \
-fill x -expand 1 -side left
bind .f.e <Return> {ico::Show $filename}
set ::dir [file dir [info script]]
proc select {} {
set fn [tk_getOpenFile -initialdir $::dir -f {
{"All Icons" .exe} {"All Icons" .ico} {"All Icons" .dll}
{Exe .exe} {DLL .dll} {Icon .ico} {"All files" *}}]
if {$fn ne ""} {
set ::dir [file dir $fn]
set ::filename $fn
ico::Show $fn
}
}
select
bind . <Escape> {exec wish $argv0 &; exit}if 0 {MG Oct 2nd 2004 - Edited very slightly so that the tk_getOpenFile has an option that shows .exe, .dll and .ico files all at once, so you can view all the valid "icon" files without all the spam of viewing *.*.[Eugene] 2011 February 26 - Seems that ::ico::Show isn't available anymore in ico package version 1.0.5 (the latest one teacup delivered me).Arts and crafts of Tcl-Tk programming} Category Dev. Tools Category Graphics
