NAME

ProgressIndicator -- Karma System output class


SYNOPSIS

 use Karma::Output::ProgressIndicator;
 my $pi = ProgressIndicator->at( y, x, width, iterations,
                                              Title     => '%u%%:',
                                              Bar       => '#',
                                              Backing   => ':'
 );
 for $i ( 0 .. iterations ) {
         $pi->update;
         ...

         if ( oops ) {
                 $pi->backup;
                 $i--;
         }
 } $pi->flush;

B<Bar> may be a "c string";
B<Title> is the sprintf format used to display the percent complete
portion.

Take note that in this example, the method B<flush()> is used to 
make the appearance of actual work. This simply adds a pleasing 
visual effect.

Another interesting point is the use of backup() to take a step back. Just as often one finds it necessary to jump to a specific iteration, and in this case the set() method is appropriate.


METHODS

new( y, x, width, iterations, Title, Bar, Backing, Persist )
Instantiate object. y and x are the location on the screen where the upper left corner should be displayed. width describes how wide the field should be, and iterations should be the number of times you plan on calling update.

Title should be an sprintf format containing one %u, and whatever formatting you desire. Similarly, Bar should be a Karma color string to be displayed upon each iteration. The c string Backing will be printed behind the Progress Indicator, for additional visual impact.

update()
Call this routing iteration times to complete the motion of the ProgressIndicator.

backup()
Gives the reverse effect of update().

set( iteration )
Jump to a specific point in the progress of the indicator.

flush()
A call to this method causes the progress indicator to finish up, just as though you had called update() iteration times. Usefull if your routine happens to finish early. flush will also DESTROY the object.