Tk::Tex...uperText(3)
π Tk::Tex...uperText(3) π
okay bestie, welcome to the manual page for Tk::Text::SuperText β that's the full name, your terminal just shows it squished as Tk::Tex...uperText(3) bc it has no chill about column widths. This is the User Contributed Perl Documentation version, and it's a whole glow-up. β¨
πΈ NAME πΈ
Tk::Text::SuperText β an improved text widget for Perl/Tk. like, the text widget but it went to the gym and got hobbies. π
π SYNOPSIS π
$super_text = $paren->SuperText(?options?);
yes queen, that's it. you build it off your parent widget and pass it ?options? like every other Tk widget. π¦
β¨ STANDARD OPTIONS β¨
here's the full roster of standard options this widget takes. all of them. no skipping. π
-background -highlightbackground -insertontime -selectborderwidth
-borderwidth -highlightcolor -insertwidth -selectforeground
-cursor -highlightthickness -padx -setgrid
-exportselection -insertbackground -pady -takefocus
-font -insertborderwidth -relief -xscrollcommand
-foreground -insertofftime -selectbackground -yscrollcommand
-ansicolor
See Tk::options for details of the standard options. that's where the lore lives. π
and these ones are also standard, but they're the text-y ones:
-height -spacing1 -spacing2 -spacing3
-state -tabs -width -wrap
See Tk::Text for details of these options. π«Ά
π WIDGET-SPECIFIC OPTIONS π
this is the fun part. the options that make it *Super*Text and not just RegularText. let's go one by one, i'm obsessed. π
- Name:
indentModeClass:IndentModeSwitch:-indentmodeβ tells the widget how to indent when a new line gets inserted in the text. the possible modes arenone, which means no indent at all, orauto, which parks the insertion cursor right below the first non-white space character of the previous line. auto-indent girlies rise. π§ - Name:
undoDepthClass:UndoDepthSwitch:-undodepthβ sets the max depth for the undo buffer. a number means: that's how many insert or delete operations can sit in the buffer before the oldest one gets popped out and forgotten forever (rip πͺ¦).0stops the undo feature entirely, andundefsets unlimited depth. chaos mode unlocked. - Name:
redoDepthClass:RedoDepthSwitch:-redodepthβ same energy, but for the redo buffer. a number = how many undo operations can be stored before the oldest one is popped out and forgotten.0stops the redo feature,undef= unlimited depth. β - Name:
showMatchingClass:ShowMatchingSwitch:-showmatchingβ a value of1activates the matching parentheses feature.0deactivates it. that's it, that's the whole vibe check. β - Name:
matchHighlightTimeClass:MatchHighlightTimeSwitch:-matchhighlighttimeβ sets the number of milliseconds the match highlight stays visible. with a value of0, the highlight stays on till the next match. commitment issues: none. π₯ - Name:
matchForegroundClass:MatchForegroundSwitch:-matchforegroundβ sets the foreground color for the char that gets highlighted by thematch-parenthesescommand. π - Name:
matchBackgroundClass:MatchBackgroundSwitch:-matchbackgroundβ sets the background color for the char highlighted by thematch-parenthesescommand. matching set, we love a coordinated fit. π - Name:
matchingCouplesClass:MatchingCouplesSwitch:-matchingcouplesβ sets the chars that get searched for a matching counterpart. the format is a simple string with matching chars coupled in left-right order. here's an example:{}[]()"". for double couples ("") the match is done only on the forwarding chars. iykyk. π¦ - Name:
insertModeClass:InsertModeSwitch:-insertmodeβ sets the default insert mode:insertoroverwrite. pick your fighter. π - Name:
ansiColorClass:AnsiColorSwitch:-ansicolorβ enables or disables use of theTk::TextANSIColormodule. this option was implemented by Jim Turner (THANKS for the support!) β shoutout, king, we appreciate you. π«Άπ
okay that's part 1 bestie, and no we are NOT done, there's more coming π don't go anywhere β
π DESCRIPTION π
okay bestie, sit down, hydrate, because Tk::Text::SuperText is literally the glow-up of Tk::Text. It implements so many new features on top of the standard Tk::Text widget while supporting every single one of its standard features. You use it exactly like you'd use Tk::Text β no new ritual required. β¨
And now, the new features. Buckle up. π
- Unlimited undo/redo π
fr fr, you can undo and redo whatever you deleted or inserted, whenever you want, no limits. To reset the undo and redo buffers, call this method:
$w->resetUndo;
- Rectangular selections π¦
Rectangular text zones can be selected, copied, deleted, and shifted β with the mouse or with the keyboard. It's giving very spreadsheet-core and we're obsessed.
- Selection right/left char and tab shift βοΈ
Text selections can be shifted left or right by one or more chars, or by a tab.
- Normal and 'inline' selection paste π
The 'normal' paste is the normal text paste you already know and love:
Paste Buffer:
line x
line y
Text Buffer:
line 1
line2
Normal paste at line 1:
line x
line y
line 1
line 2
The 'inline' paste works like this β Inline paste at line 1:
line x line 1
line y line 2
- Parentheses matching π§
To help you inspect nested parentheses, brackets, and other characters, SuperText has both an automatic parenthesis matching mode and a find matching command. Automatic parenthesis matching activates when you type, or when you move the insertion cursor after a parenthesis. It momentarily highlights the matching character if that character is visible in the window. To find a matching character anywhere in the file, position the cursor after it, and call the find matching command.
- Auto-indenting π
When you press the Return or Enter key, spaces and tabs get inserted so the insert point lines up under the start of the previous line. Alignment queen.
- Control codes insertion ποΈ
You can directly insert a non-printable control character in the text. yes, really.
- Commands are managed via virtual events π
Every SuperText command is bound to a virtual event, so to call it or to bind it to a key sequence you use the Tk::event functions. The author used this format for key binds so there's no direct key-to-command bind, and this gives more flexibility; however, you can use normal binds too.
Example:
$w->eventAdd('Tk::Text::SuperText','<<SelectAll>>','<Control-a>');
To set default event bindings use this method:
$w->bindDefault;
- Default key bindings are redefined (not really a feature :) π
Every virtual event has an associated public method with the same name as the event, but with the first char in lower case. For example, the <<MouseSelect>> event has a corresponding $super_text->mouseSelect method.
Here's the whole roster, virtual event/command on the left, default key binding on the right:
MouseSetInsertβ<Button1>MouseSelectβ<B1-Motion>MouseSelectWordβ<Double-1>MouseSelectLineβ<Triple-1>MouseSelectAddβ<Shift-1>MouseSelectAddWordβ<Double-Shift-1>MouseSelectAddLineβ<Triple-Shift-1>MouseSelectAutoScanβ<B1-Leave>MouseSelectAutoScanStopβ<B1-Enter>,<ButtonRelease-1>MouseMoveInsertβ<Alt-1>MouseRectSelectionβ<Control-B1-Motion>MouseMovePageToβ<2>MouseMovePageβ<B2-Motion>MousePasteSelectionβ<ButtonRelease-2>MoveLeftβ<Left>SelectLeftβ<Shift-Left>SelectRectLeftβ<Shift-Alt-Left>MoveLeftWordβ<Control-Left>SelectLeftWordβ<Shift-Control-Left>MoveRightβ<Right>SelectRightβ<Shift-Right>SelectRectRightβ<Shift-Alt-Right>MoveRightWordβ<Control-Right>SelectRightWordβ<Shift-Control-Right>MoveUpβ<Up>SelectUpβ<Shift-Up>SelectRectUpβ<Shift-Alt-Up>MoveUpParagraphβ<Control-Up>SelectUpParagraphβ<Shift-Control-Up>MoveDownβ<Down>SelectDownβ<Shift-Down>SelectRectDownβ<Shift-Alt-Down>MoveDownParagraphβ<Control-Down>SelectDownParagraphβ<Shift-Control-Down>MoveLineStartβ<Home>SelectToLineStartβ<Shift-Home>MoveTextStartβ<Control-Home>SelectToTextStartβ<Shift-Control-Home>MoveLineEndβ<End>SelectToLineEndβ<Shift-End>MoveTextEndβ<Control-End>SelectToTextEndβ<Shift-Control-End>MovePageUpβ<Prior>SelectToPageUpβ<Shift-Prior>MovePageLeftβ<Control-Prior>MovePageDownβ<Next>SelectToPageDownβ<Shift-Next>MovePageRightβ<Control-Next>SetSelectionMarkβ<Control-space>,<Select>SelectToMarkβ<Shift-Control-space>,<Shift-Select>SelectAllβ<Control-a>SelectionShiftLeftβ<Control-comma>SelectionShiftLeftTabβ<Control-Alt-comma>SelectionShiftRightβ<Control-period>SelectionShiftRightTabβ<Control-Alt-period>Insβ<Insert>Enterβ<Return>AutoIndentEnterβ<Control-Return>NoAutoindentEnterβ<Shift-Return>Delβ<Delete>BackSpaceβ<BackSpace>DeleteToWordStartβ<Shift-BackSpace>DeleteToWordEndβ<Shift-Delete>DeleteToLineStartβ<Alt-BackSpace>DeleteToLineEndβ<Alt-Delete>DeleteWordβ<Control-BackSpace>DeleteLineβ<Control-Delete>InsertControlCodeβ<Control-Escape>FocusNextβ<Control-Tab>FocusPrevβ<Shift-Control-Tab>FlashMatchingCharβ<Control-b>RemoveMatchβ<Control-B>FindMatchingCharβ<Control-j>JumpToMatchingCharβ<Control-J>Escapeβ<Escape>Tabβ<Tab>LeftTabβ<Shift-Tab>Copyβ<Control-c>Cutβ<Control-x>Pasteβ<Control-v>InlinePasteβ<Control-V>Undoβ<Control-z>Redoβ<Control-Z>Destroyβ<Destroy>MenuSelectβ<Alt-KeyPress>
- Public methods π«Ά
here's the full list, copy it into your notes app bestie:
$widget->mouseSetInsert
$widget->museSelect
$widget->mouseSelectWord
$widget->mouseSelectLine
$widget->mouseSelectAdd
$widget->mouseSelectAddWord
$widget->mouseSelectAddLine
$widget->mouseSelectAutoScan
$widget->mouseSelectAutoScanStop
$widget->mouseMoveInsert
$widget->mouseRectSelection
$widget->mouseMovePageTo
$widget->mouseMovePage
$widget->mousePasteSelection
$widget->moveLeft
$widget->selectLeft
$widget->selectRectLeft
$widget->moveLeftWord
$widget->selectLeftWord
$widget->moveRight
$widget->selectRight
$widget->selectRectRight
$widget->moveRightWord
$widget->selectRightWord
$widget->moveUp
$widget->selectUp
$widget->selectRectUp
$widget->moveUpParagraph
$widget->selectUpParagraph
$widget->moveDown
$widget->selectDown
$widget->selectRectDown
$widget->moveDownParagraph
$widget->selectDownParagraph
$widget->moveLineStart
$widget->selectToLineStart
$widget->moveTextStart
$widget->selectToTextStart
$widget->moveLineEnd
$widget->selectToLineEnd
$widget->moveTextEnd
$widget->selectToTextEnd
$widget->movePageUp
$widget->selectToPageUp
$widget->movePageLeft
$widget->movePageDown
$widget->selectToPageDown
$widget->movePageRight
$widget->setSelectionMark
$widget->selectToMark
$widget->selectAll
$widget->selectionShiftLeft
$widget->selectionShiftLeftTab
$widget->selectionShiftRight
$widget->selectionShiftRightTab
$widget->ins
$widget->enter
$widget->autoIndentEnter
$widget-> noAutoindentEnter
$widget->del
$widget->backSpace
$widget->deleteToWordStart
$widget->deleteToWordEnd
$widget->deleteToLineStart
$widget->deleteToLineEnd
$widget->deleteWord
$widget->deleteLine
$widget->insertControlCode
$widget->focusNext
$widget->focusPrev
$widget->flashMatchingChar
$widget->removeMatch
$widget->findMatchingChar
$widget->jumpToMatchingChar
$widget->escape
$widget->tab
$widget->leftTab
$widget->copy
$widget->cut
$widget->paste
$widget->inlinePaste
$widget->undo
$widget->redo
$widget->destroy
$widget->menuSelect
π AUTHOR π
Current maintainer is Alexander Becker, asb@cpan.org. π
Originally written by Alessandro Iob.
π LICENSE π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π SEE ALSO π
Tk::Text Tk::ROText Tk::TextUndo
π KEYWORDS π
text, widget
and that's a wrap on the whole page, bestie π«Ά this wasperl v5.42.0, dated2025-07-25, and it's theTk::Tex...uperText(3)manual β go forth and make your text widget absolutely ate π β¨
π¦ where this page comes from
- fedora 43: perl-Tk-Text-SuperText 0.12-11.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms