Connecting to the WWW

In addition to the basic hypertext facility mentioned before, the DejaVu framework also provides support (in the form of the web widget) for hypertext files written in HTML. The web widget displays HTML files and allows for following links defined by URLs. The public interface of the web widget looks as follows:
  interface web : widget {
    ...
    void loadhome(char *url);
  };
In addition to the standard widget functions, it offers a function loadhome, to load a home page. Using the web widget in a (Tcl) script is illustrated by the following fragment:
  web .w
  .w loadhome http://www.cs.vu.nl/~se/demo.html
In a similar way as the basic hypertext widget, the web widget allows for embedding (Tcl) script code, by using the special (non-HTML) tag hush, as illustrated below:
 <h1>Digital video for HushWWW</h1>
 <hush tcl=source [urlfile http://www.cs.vu.nl/~se/mpeg.tcl>
 You need the hush browser to play this MPEG demo 
 </hush>
The actual script code itself may be obtained from some site by using the special command urlfile. The text inbetween the hush begin and end tag will be displayed by 'ordinary' browsers, such as Mosaic and Netscape. Evaluating the script code may, similar as for the hypertext widget, result in packing additional widgets to the browser (widget), as for example a video widget showing an mpeg movie.