NAME

TUI::Dialogs::StaticText - displays fixed text inside a dialog

HIERARCHY

TObject
  TView
    TStaticText

SYNOPSIS

use TUI::Objects;
use TUI::Dialogs;

my $source = 'input.txt';
my $dest   = 'output.txt';
my $bounds = TRect->new( ax => 1, ay => 2, bx => 58, by => 5 );

my $static = TStaticText->new(
  bounds => $bounds,
  text   => "\003$source to $dest",
);

$dialog->insert($static);

DESCRIPTION

TStaticText implements a simple, non-editable text display view used mainly inside dialogs and windows. It renders a fixed text string within a rectangular area and does not accept user input.

The control supports both single-line and multi-line text. If the bounding rectangle spans multiple rows, the text is automatically wrapped to fit the available space. Explicit line breaks may also be embedded in the text.

Special formatting markers are supported for compatibility with classic Turbo Vision behavior. For example, a leading centering marker causes the text to be centered horizontally within its bounds.

TStaticText is typically used for labels, messages, and explanatory text. Related views include TLabel and TParamText.

Commonly Used Features

Most code only instantiates TStaticText with new (or new_TStaticText) and inserts it into a dialog. After initialization, it usually remains a passive display element; direct method calls are uncommon outside framework internals.

ATTRIBUTES

text

Text string displayed by the static text view (Str).

CONSTRUCTOR

new

my $static = TStaticText->new(
  bounds => $bounds,
  text   => $text
);

Creates a new static text view.

bounds

Bounding rectangle of the view (TRect).

text

Text to be displayed (Str).

new_TStaticText

my $static = new_TStaticText($bounds, $text);

Factory-style constructor using positional arguments.

This constructor is equivalent to calling new with named parameters and is provided for compatibility with traditional Turbo Vision construction patterns.

DESTRUCTOR

DEMOLISH

$self->DEMOLISH($in_global_destruction);

Destroys the static text view and releases associated resources. This method corresponds to the Turbo Vision destructor and is normally invoked automatically by the owning group.

METHODS

draw

$static->draw();

Draws the text into the view, applying wrapping and alignment rules.

getPalette

my $palette = $static->getPalette();

Returns the color palette used to draw the static text.

getText

$static->getText(\$string);

Copies the internal text string into the supplied scalar.

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) 2026 the "AUTHORS" as listed above.

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