NAME

TUI::Outline::Node - node of an outline tree used by outline viewers

SYNOPSIS

use TUI::toolkit;
use TUI::Outline;
my $root  = TNode->new(
  text      => 'Root',
  childList => $child,
  expanded  => false,
);

my $text = $root->text;             # "Root"
my $kids = $root->childList;        # $child

DESCRIPTION

TNode represents a single node of an outline tree as used by the Turbo Vision outline subsystem. Each node stores a text, a reference to its first child (childList), a reference to its next sibling (next), and whether it is currently expanded.

Trees are built by linking nodes through childList and next. A node with no children has childList set to undef; the last sibling has next set to undef.

Memory is managed automatically by Perl's reference counting, so no explicit destructor or copy handling is required.

ATTRIBUTES

text

The text displayed for this node (Str).

next

Reference to the next sibling node, or undef (TNode or undef).

childList

Reference to the first child node, or undef if the node has no children (TNode or undef).

expanded

Whether the node is expanded, i.e. its children are shown (Bool). Defaults to true.

CONSTRUCTOR

new

my $node = TNode->new(
  text      => $text,
  # optional
  (
    childList => $child | undef,    
    next      => $next  | undef,
    expanded  => $bool,
  )
);

Creates a new TNode. Only text is required. The childList and next arguments default to undef, and expanded defaults to true.

new_TNode

my $node = new_TNode($text);
my $node = new_TNode($text, $childList | undef, $next | undef);
my $node = new_TNode($text, $childList | undef, $next | undef, $expanded);

Factory constructor that mirrors the positional Turbo Vision constructor. The trailing argument $expanded is optional and defaults to true. Called with only $text, it creates a node without children and without a next sibling, and the node is expanded.

SEE ALSO

TOutlineViewer, TOutline

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