Tk::HyperText can create and manipulate ROText widgets which render HTML code.
SYNOPSIS
my $hypertext = $mw->Scrolled ("HyperText",
-scrollbars => 'e',
-wrap => 'word',
-linkcommand => &onLink, # what to do when links are clicked
-titlecommand => &onTitle, # what to do when s are found
)->pack (-fill => 'both', -expand => 1);
# insert some HTML code
$hypertext->insert ("end",""
. "Hello, world!");
WIDGET-SPECIFIC OPTIONS
-rerender
Boolean. When true (the default), the ENTIRE contents of your HyperText widget will be (re)rendered every time you modify it. In this way, if you insert, e.g. a "bold" tag and don't close it, then insert new text, the new text should logically still be in bold, and it would be when this flag is true.
When false, only the newly inserted text will be rendered independently of what else is already there. If re-rendering the page is too slow for you, try disabling this flag.
-titlecommand
This should be a CODEREF pointing to a subroutine that will handle changes in a page's title. While HTML code is being parsed, when a title tag is found, it will call this method.
The callback will received the following variables:
$widget = a reference to the HyperText widget that wants to set a title.
$title = the text in the tag.
-linkcommand
This should be a CODEREF pointing to a subroutine that will handle the clicking of hyperlinks.
The callback will received the following variables:
$widget = a reference to the HyperText widget that invoked the link.
$href = the value of the link's "href" attribute.
$target = the value of the link's "target" attribute.
-attributes
This option will allow you to define all of the default settings for the display of HTML pages. Here's an example:
my $html = $mw->Scrolled ("HyperText",
-attributes => {
body => {
bgcolor => 'white',
text => 'black',
link => 'blue',
vlink => 'purple',
alink => 'red',
},
font => {
family => 'Arial',
size => 3,
color => '', # inherit from
back => '', # inherit from
},
},
)->pack;
-basehref
The "base href" of the webpages being rendered. This should be the local file path (ex. "./demolib"). The base href can be reset using the < base > tag in a webpage. The base href is used for locating external files, such as images.
Product's homepage
Requirements:
· Perl