Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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

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?
[marto]: LanX yesterday I found out about Gish gallop tactic
[marto]: "Eugenie Scott, executive director of the National Center for Science Education, dubbed this approach the Gish gallop, describing it as "where the creationist is allowed to run on for 45 minutes or an hour, spewing forth torrents of error that the
[marto]: evolutionist hasn't a prayer of refuting in the format of a debate." She also criticized Gish for failing to answer objections raised by his opponents"
[erix]: one would hope evolutionists haven't any prayers anyway
[marto]: obviously someone could be religious, but not creationist

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2017-07-28 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (431 votes). Check out past polls.