Kirsle.net logo Kirsle.net

Tk::HyperText Rewrite

May 8, 2008 by Noah
Today I've begun reprogramming my Tk::HyperText widget. The old module didn't use any "real" HTML parsers, so it was reading the HTML code in as plain text and trying to figure out how to display it that way. The new module is going to use HTML::TokeParser, which will make the code cleaner and also more efficient and less buggy.

I've only been working on it for a couple of hours so far, and all it supports so far is the font tag, bold, italic, underline, and line breaks. Here's a screenshot:

Tk-HyperText Beta

The functionality of the module when it's done is going to be drastically different to what's currently on CPAN. I don't know if anyone has actually used Tk::HyperText in their programs yet, but the new module will definitely break programs that were relying on the methods provided by the old module. I'm thinking I'll have the module use similar methods and handlers to Wx::ActiveX::Mozilla.

Update (4:54 PM EDT) - The module now supports pretty much all the markup tags (not links, lists, or obscure tags like abbr and acronym though). Something else of interest is that only the first body tag found will recolorize the widget as a whole; any additional body tags will only override the colors of the current text style, so you can get the "AIM effect" with it (where each message can have its own background color which covers its entire horizontal space).

Body BG Colors

I'll probably have the new module on CPAN within a few days.

Update (5/9) - It supports tables now!

Tables!

Tags:

Comments

There are 0 comments on this page. Add yours.

Add a Comment

Used for your Gravatar and optional thread subscription. Privacy policy.
You may format your message using GitHub Flavored Markdown syntax.