'''WISH User Help''' megawidget
http://www.pa-mcclamrock.com/papenguinspacks.html
[http://www.pa-mcclamrock.com/wishuhelp.png]
'''WISH User Help''' is the world's simplest hypertext help system (as far as I know, anyway). It's included with all the applications you can download for free from http://www.pa-mcclamrock.com/papenguinspacks.html . You'll find it (wishuhelp.tcl) in the /usr/local/lib/wishes subdirectory of the directory the tarball is unpacked into. WISH User Help requires Tcl and Tk 8.5 (or greater, when there is an even greater version).
To include WISH User Help in an application, do basically the following things, with whatever reasonable modifications you see fit (and let me know if you run into any problems).
1. Put these or similar code snippets in your Tcl/Tk executable:
# Identify system directory ("$libdir") in which
# WISH User Help (wishuhelp.tcl) will be found:
set topdir /usr/local
set libdir [file join $topdir lib wishes]
# WISH User Help isn't yet loaded:
set helpon 0
2. Create a button, menu item, or something to invoke a procedure that in turn will invoke WISH User Help--for example:
button .help -text "HELP" -command comhelp
# Procedure for setting up user help display:
proc comhelp {} {
global helpon libdir
if {$helpon == 0} {
source [file join $libdir wishuhelp.tcl]
set helpon 1
}
uhelp ; # Set up user help window--from WISH User Help
wm title .uhelp "WISH Command Center - User Help"
set linkup [open $::helpfile r]
set helpcontents [read $linkup]
close $linkup
.uhelp.tx insert 1.0 $helpcontents
helplink .uhelp.tx; # Show links in text--from WISH User Help
.uhelp.tx mark set insert 1.0
.uhelp.tx configure -state disabled
}
3. Create a help text file (to be identified with the global variable "helpfile"), using "Link-Text," the world's simplest hypertext markup language (I think). ([WISH Supernotepad] can slightly simplify the creation of the links, with the "Link" menu item under the "HTML" menu; it can also quickly switch between "markup" and "link" display of Link-Text files, by way of the "Link-Text" checkbox under the "Display" menu.) Here's all there is to it, with examples from the [WISH Command Center] help file:
,
, or any other markup.
David McClamrock