#!/usr/bin/perl -- ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if " -otr -opr -ce -nibc -i=4 -pt=0 "-nsak=*" use strict; use warnings; use Wx (); Main( @ARGV ); exit( 0 ); sub Main { my $app = Wx::SimpleApp->new; LogoSplasher( 2 ); my $frame = Wx::Frame->new( undef, -1, "wxSplashScreenFakeText.pl", [ -1, -1 ], [ -1, -1 ], Wx::wxDEFAULT_FRAME_STYLE() | Wx::wxTAB_TRAVERSAL() ); Initialize( $frame ); MainGuiProgram( $frame ); $frame->Raise; $frame->Maximize( 1 ); return $app->MainLoop; } ## end sub Main sub LogoSplasher { my( $seconds ) = @_; my $wxperl_icon = Wx::Bitmap->new( Wx::Image->new( Wx::GetWxPerlIcon() )->Scale( 320, 320 ) ); my $splasher = Wx::SplashScreen->new( $wxperl_icon, Wx::wxSPLASH_CENTRE_ON_SCREEN() | Wx::wxSPLASH_NO_TIMEOUT(), 6000, undef, -1 ); sleep $seconds; $splasher->Hide; $splasher->Update; $splasher->Destroy; } ## end sub Splasher sub Initialize { my( $frame ) = @_; my $text = Wx::TextCtrl->new( $frame, -1, "wxSplashScreenFakeText.pl Initializing...\n", [ -1, -1 ], [ -1, -1 ], Wx::wxTE_MULTILINE() ); $frame->Show( 1 ); for( 1 .. 10 ) { select undef, undef, undef, 0.25; $text->AppendText( "wxSplashScreenFakeText.pl $_\n" ); $frame->Update; } $text->Destroy; undef $text; } ## end sub Initialize sub MainGuiProgram { my( $frame ) = @_; my @text = map { Wx::TextCtrl->new( $frame, -1, "Yo $_" ) } 1 .. 3; my $frame_sizer = Wx::BoxSizer->new( Wx::wxVERTICAL() ); $frame_sizer->Add( $_, 1, Wx::wxEXPAND() ) for @text; $frame->SetSizer( $frame_sizer ); $frame_sizer->SetSizeHints( $frame ); $frame->Layout; $frame->Update; } ## end sub MainGuiProgram