NAME

TUI::ColorSel::ColorItem - linked color item used by color dialog structures

SYNOPSIS

use TUI::Dialogs;

my $item1 = TColorItem->new(
  name  => 'Desktop',
  index => 0,
);

my $item2 = TColorItem->new(
  name  => 'Menu',
  index => 1,
);

my $list = $item1 + $item2;

my $name  = $item1->name;
my $index = $item1->index;

DESCRIPTION

TColorItem represents a singly linked list element used by TUI::Vision color selection infrastructure.

Each node stores a display name, an index value and an optional reference to the next item in the list. The structure mirrors the original Turbo Vision data model closely and is primarily used to describe available color groups and color entries.

Like the original Borland implementation, items are linked together through a simple forward list. Perl's automatic memory management removes the need for explicit allocation and disposal while preserving the original behavior.

The overloaded + operator provides a convenient way to append items to an existing chain while preserving the original Turbo Vision programming style.

ATTRIBUTES

name

Display name associated with this item (Str).

index

Numeric index associated with this item (PositiveOrZeroInt).

next

Reference to the next list element (TColorItem), or undef if this is the last item.

CONSTRUCTOR

new

my $item = TColorItem->new(
  name  => $name,
  index => $index,
  next  => $next,
);

Creates a new color item.

name

Display name of the item (Str).

index

Associated numeric index (PositiveOrZeroInt).

next

Reference to the next item in the list, or undef (TColorItem or undef).

new_TColorItem

my $item = new_TColorItem( $name, $index, $next | undef );

Factory-style constructor using positional arguments.

METHODS

add

my $item = $item1->add($item2);

Adds a color item to the end of the current list.

This method implements the + operator, allowing color items to be chained together.

OPERATORS

+

my $list = $item1 + $item2;

Appends $item2 to the end of the list beginning at $item1.

The operation returns the head element of the resulting list, allowing multiple append operations to be chained.

SEE ALSO

TColorGroup, TColorDialog

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