Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Comment on

( #3333=superdoc: 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


In reply to wxSplashScreenFakeText.pl - diy loading message by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (7)
    As of 2014-08-23 04:16 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (172 votes), past polls