Viewer object is an instance of the
Viewer class, defined in the
Viewer can display formatted text using a variety of
fonts and styles. This is accomplished mostly through the power of
the Tk text widget, but a
Viewer has a particular
interface that better matches the requirements of formatted HTML
Viewer interface is used by two types of
extensions: HTML extensions and file type extensions. Both have
roughly the same needs (displaying the output of a parser), so this
interface description applies to both cases. It is important that the
Viewer interface is only used while a parser is active;
once the parser has been closed, the viewer should not be touched.
Viewerobject has two data attributes that are relevant to parsers:
Browserobject containing the viewer, if any. This variable may be set to
None. See the
Viewerobject has several methods that are relevant to parsers. These all either insert data, which may be a text string or a subwindow, into the text stream, or change settings that affect the way subsequent elements are formatted.
viewer.new_font((fonttag, italic, bold, tt))
fontagargument is either the empty string or a header tag in lowercase, i.e..
ttarguments are boolean flags specifying whether the font should be modified to be italic, bold and/or teletype (fixed width).
marginargument is the tag name in lowercase that caused the call (e.g. 'blockquote', 'ul', 'ol' etc.), and
levelis the accumulated nesting level (an integer). The first level is
blanklineis nonzero, a blank line is inserted after the paragraph.
abswidthis not specified.
1will be enforced.
'right'. If this argument is omitted, the rule is left aligned.
viewer.textwidget as its parent.