Tk::BootSplash - wrapper for the common Tk::SplashScreen
use Tk; use Tk::BootSplash; $bootpicture = $main->Pixmap(-file => "xxx.xpm"); SetupBootSplash( -totaltime => '5000', # time is msecs -parent => $main, -application_name => $app_name, -size => '60', -image => $bootpicture, -width => '208', -height => '120', -x1 => '10', -y1 => '4', # Line 1 Txt 'Booting' -x2 => '4', -y2 => '10', # Application Name in HUGE Letters -x3 => '20', -y3 => '87', # Line 3 TxtCurrent bootphase );
This module is a fully customizable wrapper for the common Tk:SplashScreen, which can be used to ease handling of a standardized boot splash screen with picture, texts and a progress bar. (see Tk::SplashScreen for details).
NOTE: This module is less a gimmick than a feature, since we need to wait some time until all the Windows and/or Widgets are layed out in their final positions/sizes. If we won't wait we'd run the risk of having them messed up on the same position.
The TOTALTIME is the maximum time the Splash is shown.
'SetupBootSplash()' allows to intialize / configure the upcoming Splashsceen. See Options for a detailed description of the parameters understood.
SetBootPhase() Sets a new Bootphase Text and the belonging border in percent (0..100). Ex.: You can specify 20 (%) as the new border for the next call to WaitSplash().
WaitSplash() will delay the execution for faster (external) setup operations. It will either keep waiting until the current applied border is reached (and concurrently increase the progress-bar by 1%) or just do nothing.
UpdateSplash() will promote any new bootphase and or current percentage using SetBootPhase() on screen. It may be used for spreading in any external custom-initialization code to keep the Splash-texts up-to-date.
FinalizeSplash() is a helper function for the Boot-Splash-Screen finalization. It will necessary wait until the TOTALTIME is reached and safely shutdown the Splash afterwards.
'-parent' allows to specify a reference to a valid parent window. In almost every case this will be the toplevel reference, received by MainWindow::->new().
'-application_name' can be used to supply the Name of the application. It will be displayed in a dithred font across the BootImage. Note: Currently the size has to be adapted manually to the imagesize with the -size option.
'-image' must be used to supply a reference to a valid pixmap, such as generated with $main->Pixmap( -file => "xxx.xpm") .
'-width' current width of the SplashScreen, should match to used image-size.
'-height' current height of the SplashScreen, should match to used image-size.
'-x1, -y1' must be used to define the x/y Position of the Line1 Text('Booting...').
'-x2, -y2' must be used to define the x/y Position of the Line2 Text(ApplicationName).
'-x3, -y3' must be used to define the x/y Position of the Line3 Text(Current BootPhase).
Michael Krause, KrauseM_AT_gmx_DOT_net
This code may be distributed under the same conditions as Perl.
V1.0 (C) December 2003