ClassPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version

html-widget

A class of widget that renders HTML and handles clicking on links and so on. It can be used as the main pane of a web browser. (In fact, there is also an html-browser dialog that incorporates an html-widget along with other common browser widgets.)

The value property of this widget may be set to either the URL of a web site or to the pathname or path namestring of a file. Alternately you can call display-html either on this widget or on an html-browser dialog that it is on. You can navigate by calling functions such as html-widget-go-back, html-widget-go-forward, html-widget-reload, html-widget-command-change, and html-widget-stop-load. (The buttons on an html-browser call those functions, or you could make your own widgets that call them.)

On Windows only, the function html-widget-copy will copy any selected text to the clipboard, html-widget-save will save the entire page of HTML to a file, and html-widget-print will print the page. Also, on-command-change specifies the function to be called when a command's availability status has changed.

On Windows, this widget is implemented on the WebBrowser OCX control. (See def-cg-ocx-control for information on creating other Common Graphics widgets from OCX controls.) On Linux, it is implemented on the Mozilla GTK widget, but that implementation has difficulties, as we discuss next.

We have been having unsolved problems with the Mozilla GTK widget, so the CG html-widget is really supported only on Windows. It is still available on Linux, though, for personal use on any linux installations where it may still work. Also, the Mozilla widget must be installed, which generally requires installing the mozilla-dev rpm package, and the variable excl:*mozilla-library-path* must be set to the directory in which it is installed. An alternative is to call invoke-private-html-browser, though that doesn't allow embedding the third-party browser inside a CG window hierarchy.

One disadvantage of this widget is that neither of the controls on which it is based appears to provide a way to search for a text string in the HTML.

A diagram of window and widget classes is shown in Widget and window classes in cgide.htm.


Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version