NAME
TSItem - simple singly linked list node for dialog data
SYNOPSIS
use TUI::Dialogs;
my $item3 = TSItem->new( value => "third", next => undef );
my $item2 = TSItem->new( value => "second", next => $item3 );
my $item1 = TSItem->new( value => "first", next => $item2 );
my $value = $item1->value; # "first"
my $next = $item1->next; # $item2
DESCRIPTION
TSItem represents a minimal singly linked list node used by TUI::Vision dialog infrastructure. Each node stores a string value and a reference to the next node in the list, or undef if it is the last element.
This structure originates from the classic Turbo Vision record type used for managing lists of strings. In the Perl implementation, it benefits from automatic memory management and reference handling while preserving the original data model.
TSItem is typically created indirectly by helper functions or higher-level dialog components and is rarely manipulated directly in application code.
DISCUSSION
Linked lists of TSItem objects are commonly used to represent collections of dialog-related strings, such as option lists or input histories. Each node contains only the essential information required to traverse the list, keeping the structure lightweight and efficient.
Unlike container abstractions such as arrays, TSItem mirrors the original Turbo Vision design closely, which simplifies porting and maintenance of existing logic.
ATTRIBUTES
- value
-
The string value stored in this list node (Str).
- next
-
Reference to the next node in the list, or
undefif this is the last element (TSItem or undef).
METHODS
new
my $item = TSItem->new(value => $value, next => $next);
Creates a new TSItem node with the specified string value and an optional reference to the next node.
- value
-
The string value to be stored in the node (Str).
- next
-
Reference to the next
TSItemin the list, orundef(TSItem or undef).
new_TSItem
my $item = new_TSItem($aValue, $aNext | undef);
Factory constructor that creates a new list element from a string value and a reference to the next node.
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).