http://qs1969.pair.com?node_id=466937

JediWizard has asked for the wisdom of the Perl Monks concerning the following question:

Hallo,

I have a tk application I've been working on which takes a significant amount of time to initialize. I would like to have a splash screen to alert the users that things are starting up (I've had some complaints that "It doesn't look like it is doing anything" and "it is frozen" when initializing). A quick search of cpan revealed Tk::Splash, Tk::Splashscreen, and Tk::FastSplash. Which all look like they'd fit the bill. Tk::Splash and Tk::Splash screen were available in the ppm repositories I use, so I started with them. Here is a sample of my code to use Tk::SpalshScreen:

#!/usr/local/bin/perl -w use strict; use vars qw($mw $sp); use Tk; sleep(10); MainLoop; BEGIN{ require Tk::Splashscreen; use Tk; $mw = MainWindow->new(-title=>'text'); $sp = $mw->Splashscreen(); $sp->Label(-text=>'Starting up')->pack(); $sp->Splash(10000); }

When I run this, I see a window come up immediately, but it is blank (i.e. my label is not there) and when the appicaltion is done initializing another window flashes by very quickly (which appears to be may splash screen, but I can't tell as it only apears for less than 1 second). That behavior does not seem usefull in any way, did I do something wrong?

Using Tk::Spalsh, I can't even get things running. According top the docs:

$splash = Tk::Splash->Show($image, $width, $height, $title, $overrideredirect);

Should work... but there is no indication about what exacltly the "$image" argument should be. I've tried passing it a path to a gif, a jpg and a bmp, all of which result in an error. The error displays a string of random binary characters and tells me that they do not apear to be an image. What have I missed? Am a sopposed to be passing some form of image object? Or a filehandle perhaps?

Please guide me with wisdom. All Help/Suggestions appriciated

P.S. I am running Active State Perl 5.6.1 Build 633 on Windows 2000 Professional


They say that time changes things, but you actually have to change them yourself.

—Andy Warhol