NAME

Tk::ProgressSplash - create a starting splash screen with a progress bar

SYNOPSIS

BEGIN {
    require Tk::ProgressSplash;
    $splash = Tk::ProgressSplash->Show(-splashtype => 'normal',
                                       $image, $width, $height, $title,
                                       $overrideredirect);
}
...
use Tk;
...
$splash->Update(0.1) if $splash;
...
$splash->Update(1.0) if $splash;
...
$splash->Destroy if $splash;
MainLoop;

DESCRIPTION

Create a splash screen with progress bar.

METHODS

Show

The Show() method takes the same arguments as the Show() method of Tk::Splash. Additionally you can specify:

-splashtype

Set to "fast" if you want to use Tk::FastSplash instead of Tk::Splash as the underlying splash widget. "normal", "safe" or "slow" may be used for Tk::Splash. Default is "normal". Please look at "CAVEAT" in Tk::FastSplash for problems with the "fast" approach (and why you don't want it at all).

Update

Advance the progressbar and make it visible, if it was not yet visible. The argument is a floating number between 0 and 1.

Destroy

Destroy the splash widget.

PROGRESS SPEED COMPUTATION

To adjust the Update() value to the real progress speed one can set the environment variable TK_SPLASH_COMPUTE to gather some information:

env TK_SPLASH_COMPUTE=1 bbbike -public | tee /tmp/bbbike.log

The resulting file can be processed like this:

perl -nle '/^\s*([\d\.]+).*frac=([\d\.]+)/ and push @x, [$1,$2]; END { for (@x) { my($time,$frac) = @$_; printf "%.4f -> %.4f\n", $frac, ($time/$x[-1]->[0]) } }' /tmp/bbbike.log

BUGS

See Tk::Splash and Tk::FastSplash.

AUTHOR

Slaven Rezic <srezic@cpan.org>

SEE ALSO

Tk::Splash, Tk::FastSplash.