NAME

NAME

TUI::Views::DrawBuffer - temporary line buffer for screen output

HIERARCHY

TDrawBuffer (value type)
  used by TView drawing methods

SYNOPSIS

use TUI::Views;

my $buffer = TDrawBuffer->new;

$buffer->moveStr(
  0,
  'Financial Results for FY1991',
  $view->getColor(1)
);

$view->writeLine(1, 3, 28, 1, $buffer);

DESCRIPTION

TDrawBuffer represents a temporary buffer for rendering a single line of screen output. Each entry in the buffer stores both a character value and a display attribute.

This type is a lightweight value type and is not derived from TObject. Internally, it corresponds to an array of fixed width, where each element combines a character and its visual attributes.

TDrawBuffer is primarily used inside TView drawing routines. Text and attributes are written into the buffer using helper methods, and the buffer is then passed to TView methods such as writeLine or writeBuf to render the output on screen.

CONSTRUCTOR

new

my $buffer = TDrawBuffer->new();

Creates a new, empty draw buffer with a width equal to the maximum view width.

METHODS

moveBuf

$buffer->moveBuf($indent, \@source, $attr, $count);

Copies a sequence of characters from the source buffer into the draw buffer, starting at the specified position and applying the given attribute.

moveCStr

$buffer->moveCStr($indent, $string, $attrs);

Writes a string containing Turbo Vision style tilde markers into the buffer, applying the specified attributes.

moveChar

$buffer->moveChar($indent, $char, $attr, $count);

Writes a repeated character into the buffer using the given attribute.

moveStr

$buffer->moveStr($indent, $string, $attrs);

Writes a plain string into the buffer starting at the specified position and applies the given attributes.

putAttribute

$buffer->putAttribute($index, $attr);

Sets the display attribute at the specified buffer position.

putChar

$buffer->putChar($index, $char);

Sets the character value at the specified buffer position.

SEE ALSO

TUI::Views::View, TUI::Views::Window

AUTHORS

Borland International (original Turbo Vision design)
J. Schneider <brickpool@cpan.org> (Perl implementation and maintenance)

COPYRIGHT AND LICENSE

Copyright (c) 1990-1994, 1997 by Borland International

Copyright (c) 2021-2026 the "AUTHORS" as listed above.

This software is licensed under the MIT license (see the LICENSE file, which is part of the distribution).