The HTML viewer in Tycho is a widget that displays formatted HTML. Usually, the widget is displayed in a top-level window with a menu bar, tool bar, and status bar, but it can also be used as a component of a more complex widget. The HTML renderer is based on the HTML library written by Stephen Uhler of Sun Microsystems, which supports all the features of HTML 2.0. The viewer fully supports the HTTP, FTP, and mailto: protocols, so this viewer can be used to access HTML documentation across networks as well as from the local disk. HTML forms are supported, but more complex HTML features such as tables and frames are not properly supported. A sample document illustrates the HTML tags that are supported.
The HTML viewer is derived from the File class, and therefore inherits all of its features and all of the standard menus. In addition, it provides a toolbar at the top for invoking common functions.
The Location
entry widget underneath the toolbar
contains the name of the currently open file. This entry widget is
quite flexible: entering a local file name and pressing return will cause
that file to be opened. (If the file is not an HTML file, it will be
opened in the appropriate editor -- for example, a Tcl file will be
opened in a new Tcl editor window.) The entered name can also start
with a protocol name. For example, entering
http://ptolemy.eecs.berkeley.edu/index.html
and pressing Return will open the Ptolemy home page. The ftp protocol
is also supported -- entering ftp://ptolemy.eecs.berkeley.edu/
will open a directory
listing of the Ptolemy ftp site.
Local files can also be specified using the file
protocol. Either file:/users/ptolemy
or file:///users/ptolemy
will open
the indicated file.
The viewer supports the common hyperlink conventions: clicking on a hyperlink with button 1 opens the linked file in the same viewer, and clicking on a hyperlink with button 2 opens the linked file in a new viewer window.
There are some special key-bindings in the viewer:
Alt-Left, Meta-Right, Ctrl-Left
Alt-Right, Meta-Right, Ctrl-Right
The Special
menu includes an Appletviewer
choice that
will bring up a Monitor widget with the
command to run the appletviewer
on the current file.
The appletviewer
is a windowized application that displays
Java applets.
Note that not all Tcl ports support the Monitor widget, so the
Appletviewer
choice might be greyed out.
The Tycho documentation policy explains Tycho-specific HTML extensions and how to write HTML so that an index can be generated automatically by the index generator. Note that hypertext links can be to any type of file, and based on the file name extension, Tycho will open a context-specific editor. Thus, you can have hypertext links to source code, or to graphical editors.