LibUI::ProgressBar - Control that Visualizes the Progress of a Task
use LibUI ':all'; use LibUI::VBox; use LibUI::Window; use LibUI::ProgressBar; Init( { Size => 1024 } ) && die; my $window = LibUI::Window->new( 'Hang on a tick...', 320, 100, 0 ); my $box = LibUI::VBox->new(); my $progress = LibUI::ProgressBar->new(); $progress->setValue(-1); $box->append( $progress, 1 ); $window->setChild($box); $window->onClosing( sub { Quit(); return 1; }, undef ); $window->show; Main();
A LibUI::ProgressBar object represents a control that visualizes the progress of a task via the fill level of a horizontal bar.
Indeterminate values are supported via an animated bar.
Not a lot here but... well, it's just a progress bar.
new( )
my $progress = LibUI::ProgressBar->new( );
Creates a new progress bar.
setValue( ... )
$progress->setValue( 32 );
Sets the progress bar value.
Valid values are [0, 100] for displaying a solid bar imitating a percent value.
[0, 100]
Use a value of -1 to render an animated bar to convey an indeterminate value.
-1
value( )
my $complete = $progress->value( );
Returns the progress bar value.
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Sanko Robinson <sanko@cpan.org>
To install LibUI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LibUI
CPAN shell
perl -MCPAN -e shell install LibUI
For more information on module installation, please visit the detailed CPAN module installation guide.