NAME Tk::TextHighlight - a Tk::TextUndo/Tk::Text::SuperText widget with syntax highlighting capabilities, can also use Kate languages. Tk::ROTextHighlight - a Read-only version of this widget. SYNOPSIS use Tk; my $haveKateInstalled = 0; eval "use Syntax::Highlight::Engine::Kate; \$haveKateInstalled = 1; 1"; use Tk::TextHighlight; #-OR- use Tk::ROTextHighlight; my $m = new MainWindow; my $e = $m->Scrolled('TextHighlight', #NOTE: always "TextHighlight"! -syntax => 'Perl', -commentchar => '#', -scrollbars => 'se', )->pack(-expand => 1, -fill => 'both'); if ($haveKateInstalled) { my ($sections, $kateExtensions) = $e->fetchKateInfo; $e->addKate2ViewMenu($sections); } $m->configure(-menu => $e->menu); $m->MainLoop; DESCRIPTION Tk::TextHighlight inherits Tk::Text::SuperText, if available, or Tk::TextUndo and all its options and methods. It provides an enhanced Tk Text widget that specializes in code-editing by additionally providing smart brace-matching / jumping between braces (but skipping ones in comments), language-specific text color-highlighting, and a "readonly" option for simply viewing text one doesn't want changed. Besides syntax highlighting, methods and bindings are provided for commenting and uncommenting as well as reindenting and unindenting a selected area, automatic intelligent indenting of new lines. Setting the *-readonly* flag or creating a symlink to the TextHighlight.pm source file and naming it ROTextHighlight.pm, then "using" it ("use Tk::ROTextHighlight") in the program provides all the same functionality in a "readonly" widget for text viewers, etc. Tk::TextHighlight also supports highlighting of all the many lauguages and file formats supported by Syntax::Highlight::Engine::Kate, if that optional module is installed. For Perl programmers in particular, TextHighlight can use either the module Syntax::Highlight::Perl, or the optional and better one: Syntax::Highlight::Perl::Improved. There is also a "PerlCool" version that leans toward "cooler" colors (greens, blues, violets), preferred by the author. One can also choose Kate's Perl highlighter: Syntax::Highlight::Engine::Kate::Perl, if the Kate modules are installed. 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. Currently there is built-in support for Bash, HTML, Perl, Pod, and Xresources. Optionally many others if *Syntax::Highlight::Engine::Kate* is installed. STANDARD OPTIONS -background -borderwidth -cursor -exportselection -font -foreground -highlightbackground -highlightcolor -highlightthickness -insertbackground -insertborderwidth -insertofftime -insertontime -insertwidth -padx -pady -relief -selectbackground -selectborderwidth -selectforeground -setgrid -spacing1 -spacing2 -spacing3 -state -tabs -takefocus -xscrollcommand -yscrollcommand WIDGET-SPECIFIC OPTIONS Name: autoindent Class: Autoindent Switch: -autoindent Boolean, when you press the enter button, should the next line begin at the same position as the current line or not. This indentation works with either spaces or tabs are used (See also: *-indentchar*). Default: false (start each new line at column 0). Name: commentchar Class: Commentchar Switch: -commentchar This is slightly misleading - it represents a string of one or more characters. Normally when using the *selectionComment()* method, each selected line is prepended with the commentchar string. A Special exception is made if the string is "/*", "(*", or "