Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

wxSplashScreenFakeText.pl - diy loading message

by Anonymous Monk
on Apr 05, 2013 at 09:51 UTC ( #1027111=CUFP: print w/ replies, xml ) Need Help??

One way to splash some text on screen , shows reusing a frame, resizing an image

#!/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

Interactive alternatives might be
wxperl_demo --show wxProgressDialog
wxperl_demo --show wxWizard

Comment on wxSplashScreenFakeText.pl - diy loading message
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://1027111]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2015-07-06 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls