DOKK / manpages / debian 12 / libtickit-widgets-perl / Tickit::WidgetRole::SingleChildContainer.3pm.en
Tickit::WidgetRole::SingleChildContainer(3pm) User Contributed Perl Documentation Tickit::WidgetRole::SingleChildContainer(3pm)

"Tickit::WidgetRole::SingleChildContainer" - role for widgets that contain a single other widget

   class Some::Widget::Class
      extends Tickit::Widget
      implements Tickit::WidgetRole::SingleChildContainer;
   ...

   $child = $widget->child

Returns the contained child widget.

   $widget->set_child( $child )

Sets the child widget, or "undef" to remove.

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

Paul Evans <leonerd@leonerd.org.uk>

2022-12-17 perl v5.36.0