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::Widget::Spinner" - a widget displaying a small text animation

Author

       Paul Evans <leonerd@leonerd.org.uk>

perl v5.40.0                                       2024-09-16                       Tickit::Widget::Spinner(3pm)

Constructor

new
          $spinner = Tickit::Widget::Spinner->new( %args );

       Constructs a new "Tickit::Widget::Spinner" object.

       Takes the following named arguments:

       chars => ARRAY
               Optional. An ARRAY reference containing the text strings to use.

       interval => NUM
               Optional. The time each string is displayed for. Defaults to 0.5.

Description

       This class provides a widget which displays a simple animation, cycling through a fixed set of strings
       with a fixed interval.

Methods

start
          $spinner->start;

       Starts the animation effect.

   stop
          $spinner->stop;

       Stops the animation effect.

Name

       "Tickit::Widget::Spinner" - a widget displaying a small text animation

Style

       The default style pen is used as the widget pen.

Synopsis

          use Tickit;
          use Tickit::Widget::Spinner;

          my $spinner = Tickit::Widget::Spinner->new(
             chars => [ "<X>  ", " <X> ", "  <X>", ">  <X", "X>  <" ],
          );

          Tickit->new( root => $spinner )->run;

See Also