package require winhelp

set chmfile [file join [file dirname [info script]] sample.chm]

wm title . "Press F1 on field for help"

foreach name {firstname lastname street city zip country phone fax} {
   frame .$name
   label .$name.l -text [string toupper $name] -width 10 -anchor e
   entry .$name.e -width 30
   bind .$name.e <F1> [list help ${name}.html]
   pack .$name.l .$name.e -side left
   pack .$name -side top -fill x
}

proc help {topic} {
   global chmfile
   winhelp . $chmfile $topic
}
