NAME

TUI::Dialogs::Label - descriptive label linked to another dialog control

HIERARCHY

TObject
  TView
    TStaticText
      TLabel

SYNOPSIS

use TUI::Dialogs;

my $label = TLabel->new(
  bounds => $bounds,
  text   => '~N~ame:',
  link   => $inputLine
);

DESCRIPTION

TLabel represents a static text label that is explicitly linked to another dialog control. Unlike TStaticText, a label forwards activation events to its linked control, allowing users to focus or activate that control by clicking the label or using a keyboard shortcut.

Hotkey activation is supported through marked characters in the label text. When the corresponding key combination is pressed, focus is transferred to the linked control.

Labels are typically used as prompts for input fields, list boxes, or other dialog elements and are commonly paired with controls such as TInputLine or radio button groups.

ATTRIBUTES

The following attributes are exposed as read-only accessors and are managed internally by the label implementation.

Reference to the control associated with this label (TView). If set, activation of the label selects the linked control.

light

Indicates whether the label is currently displayed in its highlighted variant (Bool). This state is managed internally.

CONSTRUCTOR

new

my $label = TLabel->new(
  bounds => $bounds,
  text   => $text,
  link   => $link
);

Creates a new label with the specified bounds, text, and optional link target.

bounds

Bounding rectangle of the label (TRect).

text

Text displayed by the label. Marked characters may be used to define a hotkey (Str).

link

Optional control that receives focus when the label is activated (TView). This parameter may be omitted.

new_TLabel

my $label = new_TLabel($bounds, $text, | $link);

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.

METHODS

draw

$label->draw();

Draws the label using the palette returned by getPalette and renders any hotkey markers.

getPalette

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

Returns the color palette used to draw the label.

handleEvent

$label->handleEvent($event);

Processes mouse and keyboard events. Activation events are forwarded to the linked control, if present.

shutDown

$label->shutDown();

Releases internal references during shutdown.

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).