User Control Panel
Advertisements

HELP US, HELP YOU!

Tk::HTML

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl
View unanswered posts
Author Message
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Aug 01, 2005 12:55 am    Post subject: Tk::HTML Reply with quote

Browsing around on CPAN, I found this module Tk::HTML.

http://search.cpan.org/~ni-s/Tk-HTML-3.003/

It doesn't seem to come with any synopsis or examples of its use. There's also a Tk::HTMLText which I guess is for HTML codes in a text widget.

Had this code to try to test it:
Code:
#!/usr/bin/perl -w

use strict;
use warnings;

use Tk;
use Tk::HTML;
use Tk::HTMLText;

my $html = qq~
<html>
<head>
<title>Example of HTML constructs</title>
</head>
<body>
<h1>Level1 heading</h1>
<h2>Level2 heading</h2>
<h3>Level3 heading</h3>
<h5>Level5 heading</h5>
Different font effects:
<ul>
<li><CODE>CODE</CODE>
<li><KBD>KBD</KBD>
<li><EM>EM</EM>
<li><VAR>VAR</VAR>
<li><B>BOLD</B>
<li><I><B>ITALIC BOLD</B></I>
</ul>
<hr>
<ol>
<li>Item 1
<ul>
<li>sub-item 1
<ul>
<li>sub-item 1
<ul>
<li>sub-item 1
<li>sub-item 2
<li>sub-item 3
<li>sub-item 4
</ul>
<li>sub-item 2
<li>sub-item 3
<li>sub-item 4
</ul>
<li>sub-item 2
<li>sub-item 3
<li>sub-item 4
</ul>
<li>Item 2
<h4>Level4 heading</h4>
<dir>
<li>sub-item 1
<li>sub-item 2
<li>sub-item 3
<li>sub-item 4
</dir>
<li>Item 3
<menu>
<li>sub-item 1
<li>sub-item 2
<li>sub-item 3
<li>sub-item 4
</menu>
<li>Item 4</li> Other text outside <i>&lt;li&gt;</i>
<li>Item 5 Other text inside <i>&lt;li&gt;</i>
<li>Item 6
<pre>
   A block of <i>&lt;pre&gt;</i> Text
   - ----- -- <i>&lt;---&gt;</i> ----
</pre>
<li>Item 7
<ol>
<li>sub-item 1
<li>sub-item 2
<li>sub-item 3
<li>sub-item 4
</ol>
<li>Item 8
<li>Item 9
<li>Item 10
</ol>
</body>
</html>
~;

my $main = MainWindow->new (
   -title => 'HTML Test',
);
$main->geometry ('640x480');

my $text = $main->Scrolled ('HTMLText',
   -scrollbars => 'oe',
)->pack (-fill => 'both', -expand => 1);
$text->insert ('end',$html);

MainLoop;


But all that gets me is a relatively normal looking text field actually showing the code and not rendering it.

Anybody know how these modules are supposed to work/have synopses?

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group