Posted to tcl by patthoyts at Tue Feb 26 20:15:41 GMT 2008view pretty

# Quick img viewer: call with path to image file as command line arg
package require Tk
package require Img

proc Main {filename} {
   set img [image create photo -file $filename]
   label .image -image $img
   button .b0 -text Button0
   button .b1 -text Button 1
   grid .image - -  -sticky news
   grid .b0 .b1 -sticky e
   grid rowconfigure . 0 -weight 1
   grid columnconfigure . 0 -weight 1
}

if {!$tcl_interactive} {
   set r [catch [linsert $argv 0 Main] err]
   if {$r} {tk_messageBox -message $err}
   exit $r
}