Tk::TextHighlight is a TextUndo widget with syntax highlighting capabilities.
SYNOPSIS
use Tk;
my $haveKateInstalled = 0;
eval "use Syntax::Highlight::Engine::Kate; $haveKateInstalled = 1; 1";
require Tk::TextHighlight;
my $m = new MainWindow;
my $e = $m->Scrolled("TextHighlight",
-syntax => "Perl",
-scrollbars => "se",
)->pack(-expand => 1, -fill => "both");
if ($haveKateInstalled) {
my ($sections, $kateExtensions) = $e->fetchKateInfo;
$e->addKate2ViewMenu($sections);
}
$m->configure(-menu => $e->menu);
$m->MainLoop;
Tk::TextHighlight inherits Tk::TextUndo and all its options and methods. Besides syntax highlighting, methods are provided for commenting and uncommenting as well as indenting and unindenting a selected area, matching pairs of braces, brackets and brackets and curlies and automatic indenting of new lines.
If you want your widget to be read-only, then require Tk::ROTextHighlight, which is based on Tk::ROText instead of Tk::TextUndo.
Syntax highlighting is done through a plugin approach. Adding languages is a matter of writing plugin modules. Theoretically this is not limited to programming languages. The plugin approach could also provide the possibility for grammar or spell checking in spoken languages.
Product's homepage
Requirements:
· Perl