Tk-TextHighlight
view release on metacpan or search on metacpan
Default: true (but practically false, since *-autoindent* currently
defaults to false).
Name: syntax
Class: Syntax
Switch: -syntax
Specifies the language for highlighting. At this moment the possible
values are None, HTML, Perl, Pod Kate::*Language*, and Xresources.
Default: None
If Syntax::Highlight::Engine::Kate is installed, you may specify any
language that the Kate syntax highlight engine supports.
Alternatively it is possible to specify a reference to your
independent plugin.
Name: syntax
Class: Syntax
Switch: -syntaxcomments
Boolean, when set to *true*, the *-commentchar* will be set
(overridden) to the comment string for the specific language
(*-syntax*) for certain supported languages (C, C++, CSS, HTML,
Modula-II, Pascal, Perl, and XML).
Default: false (use the preset string in -commentchar.
Name: Not available
Class: Not available
Switch: -updatecall
Here you can specify a callback that will be executed whenever the
insert cursor has moved or text has been modified, so your
application can keep track of position etc. Don't make this callback
to heavy, the widget will get sluggish quickly!
Default: none (sub {})
METHODS
addKate2ViewMenu(*sections*)
Inserts the list of Kate-supported languages to the widget's Syntax.
View right-mousebutton popup menu along with the basic
TextHight-supported choices. These choices can then be selected to
change the current language-highlighting used in the text in the
widget. sections is a hash-ref normally returned as the 1st item in
the list returned by fetchKateInfo. NOTE: No menu items will be
added if Kate is not installed or if -noRulesMenu or -noSyntaxMenu
are set!
Backspace()
Mostly for internal use - Handles user-pressing of the [backspace]
key so that it's not passed down to the underlying *Text* widgets.
This is so we can have consistant behavior regardless of which one
us chosen/loaded.
beginUndoBlock
Used in application programs when wishing to group together a series
of edits that, in the event of a call to Undo() should be undone
together as a group. This method should be called before the first
insertion or deletion. See also endUndoBlock.
clipboardCopy
Copies any selected text to the system's CLIPBOARD paste-buffer.
Default bindings: Control-c.
clipboardCut
Default bindings: Control-x.
Deletes the selected text from the widget and puts it in the
system's CLIPBOARD paste-buffer.
clipboardPaste
Pastes the content of the system's CLIPBOARD paste-buffer at the
current cursor position and selects it.
Default bindings: Control-v.
delete(*index1, ?index2?*)
Delete a range of characters from the text. If both index1 and
index2 are specified, then delete all the characters starting with
the one given by index1 and stopping just before index2 (i.e. the
character at index2 is not deleted). If index2 doesn't specify a
position later in the text than index1 then no characters are
deleted. If index2 isn't specified then the single character at
index1 is deleted. It is not allowable to delete characters in a way
that would leave the text without a newline as the last character.
The command returns an empty string. If more indices are given,
multiple ranges of text will be deleted. All indices are first
checked for validity before any deletions are made. They are sorted
and the text is removed from the last range to the first range to
deleted text does not cause a undesired index shifting side-effects.
If multiple ranges with the same start index are given, then the
longest range is used. If overlapping ranges are given, then they
will be merged into spans that do not cause deletion of text outside
the given ranges due to text shifted during deletion.
doAutoIndent(*boolean*)
Checks the indention of the previous line and indents the line where
the cursor is equally deep. If a <true> value is passed in, and
*-autoindent* is set to *true*. Otherwise, *false* will cause no
indentation to be added when pressing the *Return* key. Note if both
*-autoindent* and *-smartindent* are set to *true* values,
indentation will also be affected by the indentation of the next
line, and whether the current line ends with an opening brace
character or the next line begins with an opening brace character,
causing indentation to be more typical to that used in computer
source code. *-smartindent* is ignored if *-autoindent* is false.
Default bindings: Return key: doAutoIndent(*true*), Shift-Return:
doAutoIndent(*false*)
EmptyDocument()
Resets the widget to an empty state (ie. $w->delete('0.0', 'end'),
except is actionable even if the widget is readonly!
extendSelect()
Selects text between the insert cursor to the current mouse position
when pressed, then adjusted again if the mouse is released in a
different place than when pressed. The insert cursor should remain
in it's current location (like a pivot point).
Default bindings: Shift-ButtonPress-3, and ButtonPress-3 if the
*-noPopupMenu* option is set to *true*.
endUndoBlock()
Used in application programs when wishing to group together a series
of edits that, in the event of a call to Undo() should be undone
together as a group. This method should be called after the last
insertion or deletion. See also beginUndoBlock.
fetchKateInfo()
Returns 3 hashrefs containing information about the installed Kate
( run in 0.926 second using v1.01-cache-2.11-cpan-84e82930d8c )