The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

FLTK::TextDisplay -

Description

Functions

append

$textdisplay->append( $text );

Append text to the end of the buffer.

at

my $chr = $textdisplay->at( $index );

Same as text()[$index], but may be faster in plausible implementations. No bounds checking is done.

buffer

$textdisplay->buffer( $buffer );

Attach a text buffer to display, replacing the current buffer (if any).

my $buffer = $textdisplay->buffer( );

Get the associated text buffer.

cursor_color

my $color = $textdisplay->cursor_color( );

Returns cursor color.

$textdisplay->cursor_color( $color );

Set cursor color.

cursor_on

my $state = $textdisplay->cursor_on( );

Returns cursor visibility state.

cursor_style

$textdisplay->cursor_style( $style );

Set cursor style.

find_next_char

my $start = $textdisplay->find_next_char( $position );

Finds the start of the next character, starting from $position. If $position points to the start of a character, it is returned. This is mainly used with UTF-8 strings.

find_prev_char

my $start = $textdisplay->find_prev_char( $position );

Finds the start of the previous character, starting from $position. If $position points to the start of a character, it is returned. This is mainly used with UTF-8 strings.

hide_cursor

$textdisplay->hide_cursor( );

Hide cursor.

highlight_data

$textdisplay->highlight_data( $styleBuffer, $styleTable, $nStyles, $unfinishedStyle, \&unfinishedHighlightCB, $cbArg );

Attach (or remove) highlight information in text display and redisplay. Highlighting information consists of a style buffer which parallels the normal text buffer, but codes font and color information for the display; a style table which translates style buffer codes (indexed by buffer character - 'A') into fonts and colors; and a callback mechanism for as-needed highlighting, triggered by a style buffer entry of "unfinishedStyle". Style buffer can trigger additional redisplay during a normal buffer modification if the buffer contains a primary TextSelection.

Style buffers, tables and their associated memory are managed by the caller.

hor_offset

my $offset = $textdisplay->hor_offset( );

Returns the current horizontal offset

in_selection

my $inside = $textdisplay->in_selection( $X, $Y );

Returns a true value if position ($X, $Y) is inside of the primary TextSelection.

insert

$textdisplay->insert( $text );

Insert text to the current cursor position.

insert_position

$textdisplay->insert_position( $newPos );

Set new cursor position.

my $currentPos = $textdisplay->insert_position( );

Get current cursor position.

line_end

my $end = $textdisplay->line_end( $position, $start_pos_is_line_start );

Returns the end of the line where $position is located.

line_start

my $start = $textdisplay->line_start( $position );

Returns the beginning of the line where $position is located.

linenumber_width

$textdisplay->linenumber_width( $width );

Set line number area width.

my $width = $textdisplay->linenumber_width( );

Returns line number area width.

move_down

my $okay = $textdisplay->move_down( );

Move curosr down.

move_left

my $okay = $textdisplay->move_left( );

Move cursor to the left.

move_right

my $okay = $textdisplay->move_right( );

Move cursor to the right.

move_up

my $okay = $textdisplay->move_up( );

Move cursor up.

new

my $group = $textdisplay->new( $x, $y, $w, $h, $label );

Creates a new TextDisplay widget using the given position, size, and label string.

next_word

$textdisplay->next_word( );

Go to the next word.

Go to the previous word.

overstrike

$textdisplay->overstrike( $text );

Overstrike text from the current cursor position.

position_to_xy

my $in_range = $textdisplay->position_to_xy( $position, $X, $Y );

Translates a buffer text position to the XY location where the top left of the cursor would be positioned to point to that character. Returns 0 if the position is not displayed because it is vertically outof view. If the position is horizontally out of view, returns the X coordinate where the position would be if it were visible.

redisplay_range

$textdisplay->redisplay_range( $start, $end );

Redisplay text in a defined range.

scroll

$textdisplay->scroll( $topLineNum, $horizOffset );

Scroll to a new position.

show_cursor

$textdisplay->show_cursor( $b );

Show cursor.

show_insert_position

$textdisplay->show_insert_position( );

Make cursor position visible in screen.

size

my $length = $textdisplay->size( );

Returns the number of characters in text(). This may be greater than length($input->text()) if there are NULL characters in it.

static_text

my $ret = $textdisplay->static_text( $string );

Same as text($string), except it does not copy the string, instead it makes text() return a pointer to $string.

$string must point to static memory that will not be altered until at least the TextDisplay widget is destroyed or the text() is changed again. If the user attempts to edit the string it is then copied to the internal buffer and the editing done there. This can save a lot of time and memory if your program is changing the string to various constants a lot but the user rarely edits it.

text

my $string = $textdisplay->text( );

The current string, as edited by the user. size() returns how many bytes are in the string.

$textdisplay->text( $string );

Set the text.

top_line

my $index = $textdisplay->top_line( );

Returns the current visible topline.

total_lines

my $count = $textdisplay->total_lines( );

Returns the total number of lines.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 349:

Unknown directive: =cor

Around line 510:

=over without closing =back