logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Author

       Paul Evans <leonerd@leonerd.org.uk>

perl v5.40.0                                       2024-09-16             Tickit::WidgetR...eChildContainer(3pm)

Description

       Applying this role to a Tickit::Widget subclass adds behaviour for it to act as a container widget
       holding a single child widget.

Methods

child
          $child = $widget->child;

       Returns the contained child widget.

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

Name

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

Synopsis

          class Some::Widget::Class
             :isa(Tickit::Widget)
             :does(Tickit::WidgetRole::SingleChildContainer);

          ...

See Also