Help::HtmlView - HTML Display Widget
The Fl::HtmlView widget displays HTML text. It's based on Fl_Help_View. Why is the widget not Fl_Html_View upstream? I don't know either... Anwyay! Here we go!
Most HTML 2.0 elements are supported, as well as a primitive implementation of tables. GIF, JPEG, and PNG images are displayed inline.
=ipp://
Fl::HtmlView inherits from Fl::Group and Fl::Widget. On top of that, it exposes the following methods...
my $hv_a = Fl::HtmlView->new(0, 0, 250, 500, 'Important Stuff'); my $hv_b = Fl::HtmlView->new(0, 0, 250, 500);
The constructor creates a new widget using the given position, size, and label.
The destructor removes the widget.
$hv_b->clear_selection();
Removes the current text selection.
$hv_b->directory();
Returns the current directory for the text in the buffer.
$hv_b->filename();
Returns the current filename for the text in the buffer.
my $position = $hv_b->find('summer'); $position = $hv_b->find('summer', $position);
Finds the specified string at starting $position. Default value for $position is zero (0) which would obviously start the search at the beginning.
$position
0
The return value is the matching position or -1 if the search string is not found.
-1
my $position = $hv_b->leftline( );
Gets the left position in pixels.
$hv_b->leftline( 20 );
Scrolls the text to the indicated position, given a pixel column.
If the given pixel value left is out of range, then the text is scrolled to the left or right side of the document.
This method assigns a callback function to use when a link is followed or a file is loaded (via Fl::HtmlView->load()) that requires a different file or path.
The callback function receives a pointer to the Fl::HtmlView widget and the URI or full pathname for the file in question. It must return a pathname that can be opened as a local file or undef.
undef
The link function can be used to retrieve remote or virtual documents, returning a temporary file that contains the actual data. If the link function returns undef, the value of the Fl::HtmlView widget will remain unchanged.
If the link callback cannot handle the URI scheme, it should return the uri value unchanged or set the value() of the widget before returning undef.
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Sanko Robinson <sanko@cpan.org>
To install Fl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fl
CPAN shell
perl -MCPAN -e shell install Fl
For more information on module installation, please visit the detailed CPAN module installation guide.