Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
If the samples aren't working you probably don't have the latest version, or you grabbed active perl's ppm (which seems to be flaky). It is best if you download it from dada.perl.it. Below is a piece of code that should show you "Hello World".
use strict; use Win32::GUI; # First we create a window my $window = Win32::GUI::Window->new ( -width => 200, # Set the width -height => 200, # Set the height -text => "Hello World Title", # Set the title -name => "window1", # Set the name (used for event handlers) ); # Next we create a font (optional) my $font = Win32::GUI::Font->new ( -size => 20, # Set the size (in points) -name => "Comic Sans MS", # Name of the font ); # Then we add a lable to our window my $lable = $window->AddLabel( -text => "Hello World", # Set the text in the label -font => $font, # Set the font -foreground => [0, 0, 255], # Set the color of the text ); # Make sure you show your window $window->Show (); # This starts the event loop so we can now respond to events Win32::GUI::Dialog(); # The only event we want to respond to is the terminate event # The name of a sub to run an event is in the form "name_event" # If the terminate event sub is not specified your program won't exit +if you hit the x sub window1_Terminate { return -1; # Return -1 to end the event loop }

In reply to Re: How do I use Win32::GUI properly? by c-era
in thread How do I use Win32::GUI properly? by punksk8er

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 exploiting the Monastery: (4)
    As of 2014-09-22 05:01 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (178 votes), past polls