Tk::ProgressSplash - create a starting splash screen with a progress bar
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;
Create a splash screen with progress bar.
The Show() method takes the same arguments as the Show() method of Tk::Splash. Additionally you can specify:
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).
Advance the progressbar and make it visible, if it was not yet visible. The argument is a floating number between 0 and 1.
Destroy the splash widget.
To adjust the Update() value to the real progress speed one can set the environment variable TK_SPLASH_COMPUTE to gather some information:
TK_SPLASH_COMPUTE
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
See Tk::Splash and Tk::FastSplash.
Slaven Rezic <srezic@cpan.org>
Tk::Splash, Tk::FastSplash.
To install Tk::Splash, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tk::Splash
CPAN shell
perl -MCPAN -e shell install Tk::Splash
For more information on module installation, please visit the detailed CPAN module installation guide.