Paul Evans > Tickit-Widgets > Tickit::Widget::Spinner

Download:
Tickit-Widgets-0.19.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Module Version: 0.19   Source  

NAME ^

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

SYNOPSIS ^

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

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

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

DESCRIPTION ^

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

STYLE ^

The default style pen is used as the widget pen.

CONSTRUCTOR ^

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

METHODS ^

$spinner->start

Starts the animation effect.

$spinner->stop

Stops the animation effect.

AUTHOR ^

Paul Evans <leonerd@leonerd.org.uk>

syntax highlighting: