Tk::BarberPole - A rotating barber pole
use Tk::BarberPole; $pole = $parent->BarberPole( -width => 200, -length => 20, -bg => 'white', -orientation => 'vertical', -colors => [qw/red blue/], -slant => 38, -stripewidth => 15, -separation => 35, -delay => 50, -autostart => 1, ); $pole->start; $pole->stop;
Tk::BarberPole is a widget in the shape of a rotating barber pole. Animation can be started and stopped programatically.
The following standard widget options are supported:
Defaults to 0.
Defaults to flat.
flat
If set to a true value, animation of the barber pole automatically starts at widget creation. The animation can be further controlled via the start and stop methods. Defaults to 1.
Specifies the colors of the stripes. The value must be an anonymous list of the colors. The number of stripes will always be a multiple of the number of colors specified. Defaults to ['red', 'blue'].
['red', 'blue']
The delay, in milliseconds, between successive updates of the stripe positions. Each update moves the stripes by one pixel. The smaller the delay, the faster the animation. Defaults to 50.
Specifies the desired long dimension of the BarberPole in screen units (i.e. any of the forms acceptable to Tk_GetPixels). For vertical BarberPoles this is the height; for horizontal ones it is the width. Defaults to 100.
Specifies the orientation of the BarberPole. Valid values are 'horizontal', and 'vertical'. Defaults to 'horizontal'.
Specifies the distance, in pixels, between successive stripes. Defaults to 20.
Specifies the angle, in degrees, of each stripe. Defaults to 45.
Specifies the width of each stripe in pixels. Defaults to 10.
Specifies the desired short dimension of the BarberPole in screen units (i.e. any of the forms acceptable to Tk_GetPixels). For vertical BarberPoles this is the width; for horizontal ones it is the height. Defaults to 30.
Starts the animation.
Stops the animation.
Either the usual:
perl Makefile.PL make make install
or just stick it somewhere in \@INC where perl can find it. It's in pure Perl.
Ala Qumsieh <aqumsieh@cpan.org>
Copyright (c) 2004 Ala Qumsieh. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Tk::BarberPole, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tk::BarberPole
CPAN shell
perl -MCPAN -e shell install Tk::BarberPole
For more information on module installation, please visit the detailed CPAN module installation guide.