Tcl/Tk Extension for Accessing Microsoft® Windows HTML Help
     
 
 
 
Tcl Powered   Since the release of Windows 98 the Windows help system is based on HTML. The HTML documents making up a help page collection are packaged and compressed into archives with the .CHM extension. A C API and a standalone executable exist to view and navigate these archives. The archives are created with the HTML Help Workshop provided by Microsoft.

To access .CHM archives from Tcl/Tk I wrote an extension which can be downloaded from here both in binary and source form.
 
Usage   To load the extension into a running wish invoke

package require winhelp
This makes a new Tcl command named winhelp which takes two or three arguments, 1. the path name of the toplevel window on whose behalf the HTML help window is to be popped up, 2. the file name of the .CHM HTML help archive, and optionally 3., the HTML file within that archive to be displayed. The third argument may contain a named anchor, eg foo.html#bar in order to jump to position bar within the document foo.html.

The following code snippet exercises context sensitive help:

package require winhelp 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 20 bind .$name.e <F1> [list help $name] pack .$name.l .$name.e -side left pack .$name -side top -fill x } proc help {topic} { winhelp . sample.chm ${topic}.html }
For each entry widget a seperate HTML document is provided, eg firstname.html. The documents are packaged using the following HTML Help Workshop project file:

[OPTIONS] Compiled file=sample.chm Default Window=Default Default topic=.\default.html Display compile progress=No Language=0x0 [WINDOWS] Default="Sample",,,"default.html",,,,,,0x42120,,0x200c,[101,8,826,734],,0x4,,1,,,0 [FILES] .\default.html .\firstname.html .\lastname.html .\street.html .\city.html .\zip.html .\country.html .\phone.html .\fax.html
Alternatively, a single HTML document for the help text can be used and the topic selection can be done by named anchors within the document, eg

proc help {topic} { winhelp . sample.chm sample.html#$topic }

 
Download   Source code (.ZIP, 22 kByte)
Contains C source code, makefiles for MS Visual C++ 6.0, and above sample code.

Binaries for Tcl/Tk 8.0 (.ZIP, 18 kByte)
To install it, simpy unzip the contained winhelp1.0 directory to path-of-tcl-installation\lib\tk8.0.

Binaries for Tcl/Tk 8.1 and above using Tcl Stubs (.ZIP, 19 kByte)
To install it, simpy unzip the contained winhelp1.0 directory to path-of-tcl-installation\lib\tk8.[123].

Tcl/Tk 8.0 manual (.CHM, 509 kByte) wrapped from http://dev.scriptics.com/man/tcl8.0. The corresponding HTML Help Workshop project file is here.

Tcl/Tk 8.3 manual (.CHM, 602 kByte) wrapped from http://dev.scriptics.com/man/tcl8.3. The corresponding HTML Help Workshop project file is here.
 
Licensing   The extension is distributed under the same terms as Tcl/Tk, see license.terms.

 





chw@ch-werner.de
Last update 2000-09-18