ActiveTcl User Guide
|
||
widget with the capability of displaying HTML formatted docu- ments. iwidgets::scrolledhtml pathName ?options? itk::Widget <- iwidgets::Labeledwidget <- iwidgets::Scrolledtext <- iwid- gets::Scrolledhtml
activeBackground background borderWidth cursor exportSelection foreground highlightColor highlightThickness insertBackground insertBorderWidth insertOffTime insertOnTime insertWidth padX padY relief
tions.
activeRelief elementBorderWidth
jumptroughColor
associated options.
spacing1 spacing2 spacing3 state
ciated options.
labelBitmap labelFont labelImage
labelMargin
herited options.
sticky
herited options.
status. The command is executed in the form command
<number of characters
remaining>
ter text (such as <pre>...</pre> or <tt>...</tt>.) The size, style, and other font attributes are determined by the format tags in the document. The default is courier.
acter spaced text. The size, style, and other font attributes
are determined by the format tags in the document. The default is
times.
um, large, or huge. The default is medium.
the forms acceptable to Tk_GetColor. This value may be
overridden in a particular document by the text attribute of
the Body HTML tag.
forms acceptable to Tk_GetColor. This value may be overridden in a particular document by the link attribute of the Body HTML tag.
text link. Execution is of the form linkcommand href, where href is the value given in the href attribute of the A HTML tag.
the link in any of the forms acceptable to Tk_GetColor.
The de- fault is red.
forms acceptable to Tk_GetColor. This value may be
overridden in a particular document by the bgcolor attribute
of the Body HTML tag.
ified in the html document cannot be loaded.
rendering.
_________________________________________________________________
with the additional capability to display html formatted docu- ments. An import method is provided to read an html document file, and a render method is provided to display a html formatted text string.
whose name is pathName. This command may be used to invoke vari- ous operations on the widget. It has the following general form:
pathName option ?arg arg ...?
methods.
pathName cget option Returns the current value of the configura- tion option given by option. Option may have any of the values accepted by the iwidgets::scrolledhtml command. pathName config*- ure ?option? ?value option value ...? Query or modify the con- figuration options of the widget. If no option is specified, re- turns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the iwidgets::scrolledhtml command. pathName import ?option? href
tion is -link, href is assumed to be relative to the applica- tion's current working directory. Otherwise, href is assumed to be relative to the path of the last page loaded. Href is either a filename, or a reference of the form filename#anchorname. In the latter form, fIFilename and/or anchorname may be empty. If file- name is empty, the current document is assumed. If anchorname is empty, the top of the document is assumed. pathName pwd Print the current working directory of the widget, i.e. the directory of the last page loaded. pathName render htmltext ?wd? Display
all links and images in the document. Wd defaults to the applica- tion's current working directory. pathName title Return the ti- tle of the current page, as given in the <title>...</title> field in the document.
tions: No features requiring a connection to an http server are supported. Some image alignments aren't supported, because they are not supported by the text widget. The <br> attributes deal- ing with image alignments aren't supported. Automatic table siz- ing is not supported very well, due to limitations of the text widget
package require Iwidgets 4.0
option add *textBackground white
iwidgets::scrolledhtml .sh -fontname helvetica -linkcommand this import -link"
pack .sh -padx 10 -pady 10 -fill both -expand yes
.sh import ~/public_html/index.html
<table border width="100%">
<tr><td>cell1</td><td align=right
rowspan=2>cell2</td></tr> <tr><td
colspan=2>cell3 w/ overlap</td>
</table> It hasn't been fixed because 1) it's a pain to fix,
2) it will slow tables down by a significant amount, and 3)
netscape has the same bug, as of V3.01. Sam Shen This code is based
largely on his tkhtml.tcl code from tk inspect. Tkhtml is copyright
1995 Lawrence Berkeley Laboratory. Kris Raney scrolledhtml, html,
text, widget