#!/usr/bin/wish -f

set encoding {iso8859-2}

set my_file [open $argv "r"]
fconfigure $my_file -encoding $encoding
text .t -width 40 -height 10 -xscrollcommand { .h set } -yscrollcommand { .v set }
while { [ gets $my_file radek ] > 0 } { .t insert end $radek }
close $my_file

button .b -text "OK" -command { exit 0 }
scrollbar .h -orient horizontal -command ".t xview"
scrollbar .v -orient vertical -command ".t yview"

grid .t -row 0 -column 0 -columnspan 2 -sticky "news"
grid .v -row 0 -column 2 -sticky "ns"
grid .h -row 1 -column 0 -columnspan 2 -sticky "we"
grid .b -row 2 -column 0 -columnspan 3 -sticky "s"

grid columnconfigure . 0 -weight 1
grid rowconfigure . 0 -weight 1
