Curses::UI::TextEditor(3pm) User Contributed Perl Documentation Curses::UI::TextEditor(3pm)

Curses::UI::TextEditor - Create and manipulate texteditor widgets

 Curses::UI::Widget
 Curses::UI::Searchable
    |
    +----Curses::UI::TextEditor

    use Curses::UI;
    my $cui = new Curses::UI;
    my $win = $cui->add('window_id', 'Window');
    my $editor = $win->add(
        'myeditor', 'TextEditor',
        -vscrollbar => 1,
        -wrapping   => 1,
    );
    $editor->focus();
    my $text = $editor->get();

Curses::UI::TextEditor is a widget that can be used to create a couple of different kinds of texteditors. These are:

See exampes/demo-Curses::UI::TextEditor in the distribution for a short demo of these.

-parent, -x, -y, -width, -height, -pad, -padleft, -padright, -padtop, -padbottom, -ipad, -ipadleft, -ipadright, -ipadtop, -ipadbottom, -title, -titlefullwidth, -titlereverse, -onfocus, -onblur

For an explanation of these standard options, see Curses::UI::Widget.

There are different sets of bindings for each mode in which this widget can be used.

  • <tab>

    Call the 'returreturnn' routine. This will have the widget loose its focus.

  • <cursor-left>, <CTRL+B>

    Call the 'cursor-left' routine: move the cursor one position to the left.

  • <cursor-right>, <CTRL+F>

    Call the 'cursor-right' routine: move the cursor one position to the right.

  • <cursor-down>, <CTRL+N>

    Call the 'cursor-down' routine: move the cursor one line down.

  • <cursor-up>, <CTRL+P>

    Call the 'cursor-up' routine: move the cursor one line up.

  • <page-up>

    Call the 'cursor-pageup' routine: move the cursor to the previous page.

  • <page-down>

    Call the 'cursor-pagedown' routine: move the cursor to the next page.

  • <home>

    Call the 'cursor-home' routine: go to the start of the text.

  • <end>

    Call the 'cursor-end' routine: go to the end of the text.

  • <CTRL+A>

    Call the 'cursor-scrlinestart' routine: move the cursor to the start of the current line.

  • <CTRL+E>

    Call the 'cursor-scrlineend' routine: move the cursor to the end of the current line.

  • <CTRL+W>

    Call the 'toggle-wrapping' routine: toggle the -wrapping option of the texteditor.

  • <CTRL+R>

    Call the 'toggle-showhardreturns' routine: toggle the -showhardreturns option of the texteditor.

  • <CTRL+T>

    Call the 'toggle-showoverflow' routine: toggle the -showoverflow option of the texteditor.

  • <CTRL+Y>, <CTRL+X>

    Call the 'delete-line' routine: Delete the current line.

  • <CTRL+K>

    Call the 'delete-till-eol' routine: delete the text from the current cursor position up to the end of the current line.

  • <CTRL+U>

    Call the 'clear-line' routine: clear the current line and move the cursor to the start of this line.

  • <CTRL+D>

    Call the 'delete-character' routine: delete the character that currently is under the cursor.

  • <backspace>

    Call the 'backspace' routine: delete the character this is before the current cursor position.

  • <CTRL+Z>

    Call the 'undo' routine: undo the last change to the text, up to -undolevels levels.

  • <CTRL+V>

    Call the 'paste' routine: this will paste the last deleted text at the current cursor position.

  • <any other key>

    Call the 'add-string' routine: the character will be inserted in the text at the current cursor position.

  • <h>

    Call the 'cursor-left' routine: move the cursor one position to the left.

  • <l>

    Call the 'cursor-right' routine: move the cursor one position to the right.

  • b<<k>>

    Call the 'cursor-up' routine: move the cursor one line up.

  • b<<j>>

    Call the 'cursor-down' routine: move the cursor one line down.

  • <space>, <]>

    Call the 'cursor-pagedown' routine: move the cursor to the next page.

  • <->, <[>

    Call the 'cursor-pageup' routine: move the cursor to the previous page.

  • </>

    Call the 'search-forward' routine. This will make a 'less'-like search system appear in the textviewer. A searchstring can be entered. After that the user can search for the next occurance using the 'n' key or the previous occurance using the 'N' key.

  • <?>

    Call the 'search-backward' routine. This will do the same as the 'search-forward' routine, only it will search in the opposite direction.

Curses::UI, Curses::UI::TextViewer Curses::UI::TextEntry Curses::UI::Widget, Curses::UI::Common

Copyright (c) 2001-2002 Maurice Makaay. All rights reserved.

Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de)

This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the same terms as perl itself.

2021-01-01 perl v5.32.0