HelpBrowser 1.0
HelpBrowser is a Tk widget based on the htmllib package and sample browser client developed by Stephen Uhler and maintained by Clif Flynt (the Flynt version is available at http://noucorp.com/cgi-bin/noucorp/generic.tcl?dir=/var/www/html/tcl/utilities). HelpBrowser is designed to function as a drop-in widget, callable from a Tcl/Tk application with no modification required.
Using HelpBrowser
To use HelpBrowser in your application, you need to do the following:
- Create a subdirectory in your main script directory called "html."
- Save your HTML files in the html subdirectory, and name the main page "index.html."
- In your main script, access the HelpBrowser widget with the following line:
source [file join [file dirname [info script]] htmlbrowser.tcl]
- Then, display your help files with this callback:
[list showDoc [file join [file dirname [info script]] html index.html]]
HelpBrowser Improvements
HelpBrowser updates the htmllib package in the following ways:
- The core htmllib code is modified to display hyperlinks as underlined texts, like standard browsers, rather than using raised/lowered relief.
- The client widget, which actually displays the HTML, adds buttons and icons to make navigation through help pages easier. It also adds tooltips.
- The client widget is now read-only after a selected HTML file is loaded, to avoid the end user inadvertantly changing the text.
- Handlers to support the calling of external applications for http://, ftp://, and mailto:// links have been added. These handlers support the Windows, Mac OS X, and X11 environments.
HelpBrowser is not a compiled extension; it is based on the Tk text widget. As such, it should function on any platform that Tcl/Tk supports. In addition to a standard Tcl/Tk version, a version that incorporates the Tile widget set is aso available.
Known Issues
- HelpBrowser does not support advanced HTML features such as frames or CSS.
- While the main htmllib package includes basic support for tables, this feature has not been extensively tested.
- HelpBrowser includes native support for gif images, like Tk itself. Other image formats supported by extensions such as Img should work as well, but this has not been tested.
- HelpBrowser is designed to be called from the same directory as your main script. Otherwise, the "Home" button will return a "file not found" error because it is looking for the html directory in the wrong place. If you need to call HelpBrowser from a different directory, edit the path to the html files in htmlbrowser.tcl and your own script.
Additional Documentation
Stephen Uhler's original htmllib documentation
Kevin Walzer
WordTech Software
(c) 2006 WordTech Communications LLC