The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tickit::ContainerWidget - abstract base class for widgets that contain other widgets

SYNOPSIS

 TODO

DESCRIPTION

This class acts as an abstract base class for widgets that contain at leaast one other widget object.

It maintains an ordered list of child widgets, and associates a hash of named/value pairs as options for each child. Concrete subclasses of this base can use these options to implement their required behaviour.

METHODS

@children = $widget->children

In scalar context, returns the number of contained children. In list context, returns a list of all the child widgets.

%opts = $widget->child_opts( $child_or_index )

Returns the options currently set for the given child, specified either by reference or by index.

$widget->set_child_opts( $child_or_index, %newopts )

Sets new options on the given child, specified either by reference or by index. Any options whose value is given as undef are deleted.

$widget->foreach_child( \&code )

Executes the code block once for each stored child, in order. The code block is passed the child widget and the options, as key/value pairs

 $code->( $child, %opts )

$widget->add( $child, %opts )

Adds the widget as a new child of this one, with the given options

$widget->remove( $child_or_index )

Removes the given child widget if present, by reference or index

SUBCLASS METHODS

$widget->render( %args )

Optional. An empty render method is provided for the case where the widget is purely a layout container that does not directly draw to its window. If the container requires drawing, this method may be overridden. Since the default implementation is empty, there is no need for a subclass to SUPER call it.

$widget->children_changed

Optional. If implemented, this method will be called after any change of the contained child widgets or their options. Typically this will be used to set windows on them by sub-dividing the window of the parent.

$widget->child_resized( $child )

Optional. If implemented, this method will be called after a child widget changes or may have changed its size requirements. Typically this will be used to adjusts the windows allocated to children.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>