About Tk::HyperText

Tk::HyperText is a ROText-derived text widget that renders HTML code.

Why Render HTML?

The ability to render HTML code in a Tk widget is actually very useful. Instead of dealing with all the nitty gritty stuff with text widgets and such, you can just pipe plain old HTML code directly into the widget and it will render it automatically into something very pretty to look at, with very little extra time and effort on the programmer's side.

In fact, Tk::HyperText was derived from Tk::ROText, which in turn was derived from Tk::Text. Because of that, you can just drop in Tk::HyperText as a replacement to your current text widgets, and voila: it can now render HTML code!

Example

my $html = $mw->Scrolled ("HyperText",
   -scrollbars => 'e',
   -wrap       => 'word',
)->pack (-fill => 'both', -expand => 1);

$html->insert ("end", "<b>Hello, <u>world!</u></b>");

What Can Tk::HyperText Do?

See the Supported Tags & Attributes page.

How Does Tk::HyperText Work?

Well, XML parsing is a real pain in the ass in Perl, so this module doesn't use a true XML parser. Actually, it reads the HTML code in sequence, making changes to the Tk::Text tags when new HTML tags are found, and inserting the next bit of non-html-tag text in with the current style.