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


In reply to Problems with Tk::SplashScreen and Tk::Splash by JediWizard

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.