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 provides storage for a hash of "options" associated with each child widget.

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

Sets the child widget's parent, stores the options for the child, and calls the children_changed method. The concrete implementation will have to implement storage of this child widget.

$widget->remove( $child_or_index )

Removes the child widget's parent, and calls the children_changed method. The concrete implementation will have to remove this child from its storage.

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

$opts = $widget->child_opts( $child )

Returns the options currently set for the given child as a key/value list in list context, or as a HASH reference in scalar context. The HASH reference in scalar context is the actual hash used to store the options - modifications to it will be preserved.

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

Sets new options on the given child. Any options whose value is given as undef are deleted.

SUBCLASS METHODS

@children = $widget->children

Required. Should return a list of all the contained child widgets. The order is not specified. This method is used by window_lost to remove the windows from all the child widgets automatically.

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

If not overridden, the base implementation will call reshape.

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

If not overridden, the base implementation will call reshape.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>