NAME

Tk::CodeText - a TextUndo widget with syntax highlighting capabilities


SYNOPSIS

 use Tk;
 require Tk::CodeText;
 my $m = new MainWindow;
 my $e = $m->Scrolled('CodeText',
        -disablemenu => 1,
        -syntax => 'Perl',
        -scrollbars => 'se',
 )->pack(-expand => 1, -fill => 'both');
 $m->configure(-menu => $e->menu);
 $m->MainLoop;


DESCRIPTION

Tk::CodeText 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.

Syntax highlighting is done through a plugin approach. Currently there is support for Perl, Pod, HTML and Xresources. 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.


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. By default false.

Name: commentchar
Class: Commentchar
Switch: -commentchar
By default ``#''.