NAME

TUI::ColorSel::ColorGroup - linked color group definition used by color dialog

SYNOPSIS

use TUI::ColorSel;

my $items =
    TColorItem->new(
      name  => 'Normal',
      index => 0
    )
  + TColorItem->new(
      name  => 'Selected',
      index => 1
    );

my $group = TColorGroup->new(
  name  => 'Desktop',
  items => $items,
);

my $name  = $group->name;
my $items = $group->items;

DESCRIPTION

TColorGroup represents a color group used by the TUI::Vision color selection infrastructure.

Each group contains a display name and a linked list of TColorItem objects describing the individual color entries belonging to the group.

Groups themselves may also be linked together, forming a list of available color groups.

The Perl implementation preserves the original Borland Turbo Vision data model. Each TColorGroup contains a linked list of color items accessible through the items attribute. Multiple groups may themselves be linked through the next attribute.

The overloaded '+' operator supports the original Borland Turbo Vision programming style by allowing both color items and color groups to be appended using a uniform syntax.

ATTRIBUTES

name

Display name of the color group (Str).

items

Reference to the first color item in the group, or undef if the group is empty (TColorItem or undef).

next

Reference to the next color group, or undef if this is the last group (TColorGroup or undef).

CONSTRUCTORS

new

my $group = TColorGroup->new(
  name => $name,
  item => $item,
  next => $next,
);

Creates a new color group.

name

Display name of the group (Str).

item

Reference to the first color item in the group, or undef (TColorItem or undef).

next

Reference to the next color group, or undef (TColorGroup or undef).

new_TColorGroup

my $group = new_TColorGroup(
  $name,
  $item | undef,
  $next | undef
);

Factory-style constructor using positional arguments.

METHODS

add

$group = $group->add( $item );

Appends a TColorItem to the end of the group's item list.

$group1 = $group1->add( $group2 );

Appends $group2 to the end of the color group chain beginning with $group1.

In both cases the head of the resulting structure is returned.

OPERATORS

+

$group + $item;

Appends a TColorItem to the end of the group's item list.

$group1 + $group2;

Appends $group2 to the end of the color group chain beginning with $group1.

In both cases the head of the resulting structure is returned.

SEE ALSO

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