Perl Basics
Introduction to Perl
FAQ's
CGI
Regular Expressions

PC Overview
Cool Stuff
My Modules
Success Stories
Links
Perl in the News
Logos

PC Internals
About
Contact
Handy Logos
What's new

wxPerl: Hello, World!

See also
P-friendly

[ home ] - [ search ] - [ sitemap ]


See also [ perl/GUI-Programming/index.html ]

#!/usr/bin/perl -w

use strict;

# load wxPerl main module
use Wx;

# every application must create an application object
package MyApp;

use base 'Wx::App';

# this method is called automatically when an application object is
# first constructed, all application-level initialization is done here
sub OnInit {

    # create a new frame (a frame is a top level window)
    my $frame = Wx::Frame->new( undef,           # parent window
				-1,              # ID -1 means any
				'wxPerl rules',  # title
				[-1, -1],         # default position
				[250, 150],       # size
			       );

    # show the frame
    $frame->Show( 1 );
}

package main;

# create the application object, this will call OnInit
my $app = MyApp->new;
# process GUI events from the application this function will not
# return until the last frame is closed
$app->MainLoop;
home - feedback - search

$Id: foo.htm,v 1.10 2004/03/11 17:50:01 reto Exp $
© 1998-2004 reto :)