in reply to Html rendering with Tk::HyperText

I found this usage right in the modules pod. It seems your insert should be a loadstring, and you may have to provide full html, not just fragments. Also your use of insert() after MainLoop is useless. Maybe you want it before MainLoop?

This works:

#!/usr/bin/perl -w use strict; use warnings; use Tk; use Tk::HyperText; my $mw = MainWindow->new ( -title => 'HTML Viewer', ); my $hypertext = $mw->Scrolled ("HyperText", -scrollbars => 'e', -wrap => 'word', )->pack (-fill => 'both', -expand => 1); my $btnInsert = $mw->Button ( -text => 'insert', -command => \&insert, )->pack (-side => 'right'); MainLoop; insert(); # this insert here will only run after # the MainLoop is done. Useless use. sub insert{ # insert some HTML code # $hypertext->insert ("end","<body bgcolor=\"black\" text=\"yellow\"> +" # . "Hello, <b>world!</b></body>"); $hypertext->loadString (qq~<html> <head> <title>Hello world!</title> </head> <body bgcolor="#0099FF"> <font size="6" family="Impact" color="#FFFFFF"> <strong>Hello, world!</strong> </font> </body> </html> ~); }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh