NAME
Tk::FastSplash - create a fast starting splash screen
SYNOPSIS
BEGIN {
require Tk::FastSplash;
$splash = Tk::FastSplash->Show($image, $width, $height, $title,
$overrideredirect);
}
...
use Tk;
...
$splash->Destroy if $splash;
MainLoop;
DESCRIPTION
This module creates a splash screen for perl/Tk programs. It uses lowlevel perk/Tk stuff, so upward compatibility is not given (the module should work at least for Tk800.015, .022 and .024). The splash screen is created with the Show function. Supplied arguments are: filename of the displayed image, width and height of the image and the string for the title bar. $width
and $height
may be left undefined. If $overrideredirect
is set to a true value, then the splash screen will come without window manager decoration. If something goes wrong, then Show will silently ignore all errors and continue without a splash screen. The splash screen can be destroyed with the Destroy method, best short before calling MainLoop.
If you want to run this module on a Tk402.xxx system, then you have to set the variable $Tk::FastSplash::TK_VERSION
to a value less than 800.
CAVEAT
This module does forbidden things e.g. bootstrapping the Tk shared object or poking in the Perl/Tk internals. Because of this, this module can stop working in a new Perl/Tk release. If you are concerned about compatibility, then you should use Tk::Splash instead. If your primary concern is speed, then Tk::FastSplash
is for you (and the primary reason I wrote this module). The splash window of Tk::FastSplash
should pop up 1 or 2 seconds faster than using Tk::Splash
or a vanilla Tk::Toplevel window.
BUGS
Probably many.
You cannot call Tk::FastSplash
twice in one application.
The $^W variable should be turned off until the "use Tk" call.
If FastSplash is executed in a BEGIN block (which is recommended for full speed), then strange things will happen when using perl -c
or trying to compile a script: the splash screen will always pop up while doing those things. Therefore it is recommended to disable the splash screen in check or debug mode:
BEGIN {
if (!$^C && !$^P) {
require Tk::FastSplash;
$splash = Tk::FastSplash->Show($image, $width, $height, $title,
$overrideredirect);
}
}
The -display switch is not honoured (but setting the environment variable DISPLAY will work).
AUTHOR
Slaven Rezic (slaven@rezic.de)
SEE ALSO
Tk::Splash, Tk::ProgressSplash, Tk::Splashscreen, Tk::mySplashScreen.