Tickit::SingleChildWidget - abstract base class for widgets that contain a single other widget
Tickit::SingleChildWidget
TODO
This subclass of Tickit::ContainerWidget acts as an abstract base class for widgets that contain exactly one other widget. It enforces that only one child widget may be contained at any one time, and provides a convenient accessor to obtain it.
$widget = Tickit::SingleChildWidget->new( %args )
Constructs a new Tickit::SingleChildWidget object.
As a back-compatibility option if passed an argument called child this will be added as the contained child widget. This is now discouraged as it complicates the creation of subclasses; see instead the "set_child" method used as a chaining mutator.
child
$child = $widget->child
Returns the contained child widget.
$widget->set_child( $child )
Sets the child widget, or undef to remove.
undef
This method returns the container widget instance itself making it suitable to use as a chaining mutator; e.g.
my $container = Tickit::SingleChildWidget->new( ... ) ->set_child( Tickit::Widget::Static->new( ... ) );
This should be preferred over using the child constructor argument, which is now discouraged.
Paul Evans <leonerd@leonerd.org.uk>
To install Tickit::Widgets, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tickit::Widgets
CPAN shell
perl -MCPAN -e shell install Tickit::Widgets
For more information on module installation, please visit the detailed CPAN module installation guide.