[Phoenix-pm] wxPerl: Perl questions

leegold leegold at fastmail.fm
Wed Apr 13 10:32:54 PDT 2011


Hi,

I am trying to lean wx, so far IMHO the wxPerl code is easier to
understand than wxPython in this case. What I'm going for is
simplicity here. I'm going to ask some possibly newbie questions,
I've search the web for answers but haven't come up with anything
clear so I'm asking.


>From a wxPerl program:

use Wx;
package MyApp;
use base 'Wx::App';


What is difference between a module and a package?

What exactly is MyApp? It's a package but I can't find any
documentation on it. There's no "MyApp" in my C:\Perl folder...

Tried to find info in "use base" keywords but no simple
explainations. What does "use base" do?



Here's the script:

# load wxPerl main module
use Wx;
# every application must create an application object
package MyApp;
use base 'Wx::App';
sub OnInit {

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

    $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;

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/phoenix-pm/attachments/20110413/bfd7e058/attachment.html>


More information about the Phoenix-pm mailing list