#!/usr/prac/se/hush/bin/hush -f

# Create horizonatal and vertical scrollbars
scrollbar .vs -command { .f.h yview } -orient vertical
scrollbar .hs -command { .f.h xview } -orient horizontal

frame .f -relief sunken -borderwidth 2 -geom 500x500

# Create the hypertext widget 
htext .f.h -file text2.ht \
	-yscrollcommand { .vs set } \
	-xscrollcommand { .hs set } \
	-yscrollunits 10m \
	-xscrollunits 1i 

pack append . .f fill
pack append .f .f.h { expand padx 2 pady 2 }
pack before .f .vs { right filly }
pack after .f .hs { bottom fillx }

bind .f.h <B3-Motion> {%W scan dragto %x %y}
bind .f.h <3> {%W scan mark %x %y}
bind .f.h <Control-p> { %W gotoline [expr [%W gotoline]-1] }
bind .f.h <Control-n> { %W gotoline [expr [%W gotoline]+1] }
focus .f.h

#.f.h gotoline 10
wm min . 0 0
