#
# help_ssman1d.tk
#

proc help_ssman1d(build) name {
    global COLOR env

    build_Title $name "Help working with SSMan1D"

    build_DismissButtonbar $name dbbar "window(dismiss) help_ssman1d"

    set textw [build_Scrollingtext $name tw 60 30]

    # empty text field
    $textw configure -state normal
    $textw delete 1.0 end
    set msgtxt {}

    # load helpfile

    set env_var_name MY_DSTOOL
    
    if [info exists env($env_var_name)] {
	set fname $env($env_var_name)/SSMan1D/ssman1d_help.txt
	if ![loadfile_into_text $textw $fname] {
	   	$textw insert end "Help file: $fname not found."
    	} else {
		set msgtxt $fname
    	}
    } else {
	$textw insert end \
	    "Environment variable $env_var_name not set."
    }
 
    $textw configure -state disabled

    build_Label $name.dbbar msg $msgtxt
    
    $name.dbbar.msg.label configure -fg $COLOR(info)
}

proc help_ssman1d_about(build) name {
    global COLOR Control

    if {[winfo exists $name.cmd]} {
	return
    }

    build_Title $name "About SSMan1D"

   build_DismissButtonbar $name dbbar "window(dismiss) help_ssman1d_about"

    set cmd [build_CmdFrame $name cmd]

    build_Label $cmd l0 "SSMan1D"
    $cmd.l0.label configure -font *-times-medium-i-normal--*-240-*-*-*-*-*-* \
	-fg red
    build_Label $cmd l1 "Extension module for computing\n one-dimensional strong (un)stable manifolds of vector fields"
    $cmd.l1.label configure -font *-times-medium-i-normal--*-140-*-*-*-*-*-* \
	-fg blue
    pack $cmd.l0 $cmd.l1 -anchor n -ipadx 15m -ipady 2m

    build_Label $cmd l2 "Copyright 2003\nHinke Osinga and Reza Rokni\nUniversity of Exeter"
    build_Label $cmd l3 ""
    build_Label $cmd l4 "$Control(Version)\n$Control(Build_Info)\n"
    pack $cmd.l2 $cmd.l3 $cmd.l4 -anchor n -ipady 1m

    pack $cmd -expand 1 -fill both

    #
    # don't allow user to resize
    #
    update
    window(fix_size) $name
}

