#!/bin/sh
#l \
exec wish "$0" "$@"


proc showfile { file } {

set w .tkview

toplevel $w
wm title $w "Displaying $file"
text $w.text  -relief sunken -bd 2 -xscrollcommand "$w.scrollx set" -yscrollcommand "$w.scrolly set" -setgrid 1  -height 30 -wrap none

scrollbar $w.scrolly -command "$w.text yview"
scrollbar $w.scrollx -command "$w.text xview" -orient horizontal
pack $w.scrolly -side right -fill y
pack $w.scrollx -side bottom -fill x
pack $w.text -expand yes -fill both

set f [open $file "r"]
set input [read -nonewline $f]
$w.text insert 0.0 $input
close $f

$w.text configure -state disabled
return $w

}            

wm withdraw .
set file [lindex $argv 0]
set x [showfile $file   ]
tkwait window $x
exit
