Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 15:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found