Win32::GUI::SplashScreen - Win32::GUI SplashScreen support |
Win32::GUI::SplashScreen - Win32::GUI SplashScreen support
use Win32:GUI::SplashScreen;
Win32::GUI::SplashScreen::Show([%options]);
Win32::GUI::SplashScreen::Done([$now]);
Win32::GUI::SplashScreen is a module that works with Win32::GUI to implement a Windows application splash screen.
It can generate a simple splash screen from basic text information, or use a supplied image. The splash screen can be configured to have a minimum display time (so that users always have time to read any information), and can be taken down automatically once your program reaches the dialog phase.
Win32::GUI::SplashScreen::Show(%options);
where %options
are:
$ENV{PAR_TEMP}
directories are searched for
file with no extension, and with .bmp, .jpg and .jpeg
extensions. JPEG support is only available if Win32::GUI::DIBitmap
is available.
If no other action is taken the splash screen will be taken down automatically once -mintime seconds have passsed and you have entered the dialog phase.
Only one splash screen can be diaplayed at a time.
returns 1
on success and 0
on failure.
Win32::GUI::SplashScreen::Done([$now]);
Done()
is a blocking call that waits until the -mintime has
passed since the splash screen was displayed, and takes it down.
Perhaps more usefully, if called with a TRUE parameter, takes the splash screen down NOW.
Returns 1
on success and 0
on failure (for example if there
is no splash screen showing currently).
Robert May, <robertmay@cpan.org>
Win32::GUI v1.02 or later.
Win32::GUI::DIBitmap for JPEG support.
#!perl -w use strict; use warnings;
use Win32::GUI 1.02 (); use Win32::GUI::SplashScreen;
# Create and display the splash screen # Uses default filename of 'SPLASH', and searches for # SPLASH.bmp and SPLASH.jp[e]g Win32::GUI::SplashScreen::Show();
# Create the main window my $mw = Win32::GUI::Window->new( -title => "SplashScreen Demo 1", -size => [700, 500], ) or die "Creating Main Window";
# do some other stuff sleep(1);
# show the main window and enter the dialog phase # splash screen taken down after (default) 3 seconds $mw->Center(); $mw->Show(); Win32::GUI::Dialog(); exit(0);
If you pack your GUI into an executable using PAR (See http://par.perl.org/) then add your bitmap to the PAR distributable with the -a option,
pp -a SPLASHFILE.bmp -o xxx.exe xxx.pl
where SPLASHFILE.bmp is the name of your splash screen image and Win32::GUI::SplashScreen will find it.
See the TODO file from the disribution.
Many thanks to the Win32::GUI developers at http://sourceforge.net/projects/perl-win32-gui/
Copyright 2005..2009 Robert May, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Win32::GUI::SplashScreen - Win32::GUI SplashScreen support |