1iwidgets::scrolledhtml − Create and manipulate a scrolled text
2widget with the capability of displaying HTML formatted docu‐
3ments. iwidgets::scrolledhtml pathName ?options? itk::Widget <‐
4iwidgets::Labeledwidget <‐ iwidgets::Scrolledtext <‐ iwid‐
5gets::Scrolledhtml
12See the "options" manual entry for details on the standard op‐
13tions.
15See the "scrollbar" widget manual entry for details on the above
16associated options.
19See the "text" widget manual entry for details on the above asso‐
20ciated options.
25See the "scrolledtext" class manual entry for details on the in‐
26herited options.
28See the "labeledwidget" class manual entry for details on the in‐
29herited options.
30Name: feedback
31Class: FeedBack
32Command‐Line Switch: ‐feedback
33Specifies the callback command to use to give feedback on current
34status. The command is executed in the form command <number of
36Name: fixedfont
37Class: FixedFont
38Command‐Line Switch: ‐fixedfont
39Specifies the name of the font to be used for fixed‐width charac‐
40ter text (such as <pre>...</pre> or <tt>...</tt>.) The size,
41style, and other font attributes are determined by the format
42tags in the document. The default is courier.
43Name: fontname
44Class: FontName
45Command‐Line Switch: ‐fontname
46Specifies the name of the font to be used for normal‐width char‐
47acter spaced text. The size, style, and other font attributes are
48determined by the format tags in the document. The default is
49times.
50Name: fontsize
51Class: FontSize
52Command‐Line Switch: ‐fontsize
53Specifies the general size of the fonts used. One of small, medi‐
54um, large, or huge. The default is medium.
55Name: foreground
56Class: Foreground
57Command‐Line Switch: ‐foreground
58Specifies the color of text other than hypertext links, in any of
59the forms acceptable to Tk_GetColor. This value may be overridden
60in a particular document by the text attribute of the Body HTML
61tag.
62Name: link
63Class: Link
64Command‐Line Switch: ‐link
65Specifies the default color of hypertext links in any of the
66forms acceptable to Tk_GetColor. This value may be overridden in
67a particular document by the link attribute of the Body HTML tag.
68The default is blue.
69Name: linkcommand
70Class: LinkCommand
71Command‐Line Switch: ‐linkcommand
72Specifies the command to execute when the user clicks on a hyper‐
73text link. Execution is of the form linkcommand href, where href
74is the value given in the href attribute of the A HTML tag.
75Name: alink
76Class: alink
77Command‐Line Switch: ‐alink
78Specifies the color of hypertext links when the cursor is over
79the link in any of the forms acceptable to Tk_GetColor. The de‐
80fault is red.
81Name: textBackground
82Class: Background
83Command‐Line Switch: ‐textbackground
84Specifies the background color for the text area in any of the
85forms acceptable to Tk_GetColor. This value may be overridden in
86a particular document by the bgcolor attribute of the Body HTML
87tag.
88Name: unknownimage
89Class: UnknownImage
90Command‐Line Switch: ‐unknownimage
91Specifies the name of the image file to display when an img spec‐
92ified in the html document cannot be loaded.
93Name: update
94Class: Update
95Command‐Line Switch: ‐alink
96A boolean value indicating whether to call update during html
97rendering.
98
99The iwidgets::scrolledhtml command creates a scrolled text widget
100with the additional capability to display html formatted docu‐
101ments. An import method is provided to read an html document
102file, and a render method is provided to display a html formatted
103text string.
104
105The iwidgets::scrolledhtml command creates a new Tcl command
106whose name is pathName. This command may be used to invoke vari‐
107ous operations on the widget. It has the following general form:
109exact behavior of the command. The following commands are possi‐
110ble for scrolledhtml widgets:
115See the "text" manual entry for details on the standard methods.
117See the "scrolledhtml" manual entry for details on the inherited
118methods.
119
121tion option given by option. Option may have any of the values
122accepted by the iwidgets::scrolledhtml command. pathName config‐
124figuration options of the widget. If no option is specified, re‐
125turns a list describing all of the available options for pathName
126(see Tk_ConfigureInfo for information on the format of this
127list). If option is specified with no value, then the command
128returns a list describing the one named option (this list will be
129identical to the corresponding sublist of the value returned if
130no option is specified). If one or more option−value pairs are
131specified, then the command modifies the given widget option(s)
132to have the given value(s); in this case the command returns an
133empty string. Option may have any of the values accepted by the
135Load html formatted text from a file. Href must exist. If op‐
137tion’s current working directory. Otherwise, href is assumed to
138be relative to the path of the last page loaded. Href is either a
139filename, or a reference of the form filename#anchorname. In the
140latter form, fIFilename and/or anchorname may be empty. If file‐
142empty, the top of the document is assumed. pathName pwd Print
143the current working directory of the widget, i.e. the directory
144of the last page loaded. pathName render htmltext ?wd? Display
145HTML formatted text htmltext. Wd gives the base path to use for
146all links and images in the document. Wd defaults to the applica‐
147tion’s current working directory. pathName title Return the ti‐
148tle of the current page, as given in the <title>...</title> field
149in the document.
150
151This widget is compliant with HTML 3.2 with the following excep‐
152tions: No features requiring a connection to an http server are
153supported. Some image alignments aren’t supported, because they
154are not supported by the text widget. The <br> attributes deal‐
155ing with image alignments aren’t supported. Automatic table siz‐
156ing is not supported very well, due to limitations of the text
157widget
158 package require Iwidgets 4.0
159 option add *textBackground white
160
161 iwidgets::scrolledhtml .sh ‐fontname helvetica ‐linkcommand
162"this import ‐link"
163
164 pack .sh ‐padx 10 ‐pady 10 ‐fill both ‐expand yes
165
166 .sh import ~/public_html/index.html Cells in a table can be
167caused to overlap. ex:
168 <table border width="100%">
169 <tr><td>cell1</td><td align=right rowspan=2>cell2</td></tr>
170 <tr><td colspan=2>cell3 w/ overlap</td>
171 </table> It hasn’t been fixed because 1) it’s a pain to fix,
1722) it will slow tables down by a significant amount, and 3) net‐
173scape has the same bug, as of V3.01. Sam Shen This code is based
174largely on his tkhtml.tcl code from tk inspect. Tkhtml is copy‐
175right 1995 Lawrence Berkeley Laboratory. Kris Raney scrolled‐
176html, html, text, widget
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198