Slaven Rezić
and 1 contributors


Tk::FastSplash - create a fast starting splash screen


    BEGIN {
        require Tk::FastSplash;
        $splash = Tk::FastSplash->Show($image, $width, $height, $title,
    use Tk;
    $splash->Destroy if $splash;


Tk::FastSplash is NOT SUPPORTED anymore. Please use Tk::Splash instead. Read "CAVEAT" and "BUGS".

This module creates a fast loading splash screen for Perl/Tk programs. It uses lowlevel Perl/Tk stuff, so upward compatibility is not given (the module should work at least for Tk800.015, .022, .024, .025 and Tk804.025, but does not work with newer ActivePerl versions).

Arguments for the Show method are the same as for Tk::Splash.

If you want to run this module on a system, then you have to set the variable $Tk::FastSplash::TK_VERSION to a value less than 800.


The module does not work anymore with new Tk versions (e.g. 804.032).

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.


Probably many.

If used with newer ActivePerl (e.g. build 811), then it is possible that the application becomes unusable by using strange characters.

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,

The -display switch is not honoured (but setting the environment variable DISPLAY will work).

XXX Avoid Win32 raise/lower problem with this code (maybe)?

    # Windows constants
    my ($ONTOP, $NOTOP, $TOP) = (-1, -2, 0);
    my ($SWP_NOMOVE, $SWP_NOSIZE) = (2, 1);
    my $SetWindowPos        = new Win32::API("user32", "SetWindowPos", 'NNNNNNN', 'N'); 
    my $FindWindow          = new Win32::API("user32", "FindWindow", 'PP', 'N'); 
    # Reestablish Z order
    my $class = "TkTopLevel";
    my $topHwnd = $FindWindow->Call($class, $w->title);
    $topHwnd and $SetWindowPos->Call($topHwnd, $ONTOP, 0, 0, 0, 0, $SWP_NOMOVE | $SWP_NOSIZE);


Slaven Rezic <>


Tk::Splash, Tk::ProgressSplash, Tk::Splashscreen, Tk::mySplashScreen.