ive been going crazy trying toi learn wx perl. I create gui's with wxdesigner and glade but they dont open when run.

can someone please walk me through a very simple app with 1 menu item and one panel inside main frame and walk me through wharts going on please. also would like to know how to open a panel from menu. thanks.

#!/usr/bin/perl #--------------------------------------------------------------------- +------- # Name: mosses.pl # Author: XXXX # Created: XX/XX/XX # Copyright: #--------------------------------------------------------------------- +------- use strict; use Wx; do 'mosses_wdr.pl'; # constants # WDR: classes package MyFrame; use strict; use vars qw(@ISA); @ISA=qw(Wx::Frame); use Wx::Event qw(EVT_MENU EVT_CLOSE EVT_SIZE EVT_UPDATE_UI); use Wx qw(wxOK wxID_ABOUT wxID_EXIT wxICON_INFORMATION wxTB_HORIZONTAL + wxNO_BORDER); sub new { my( $class ) = shift; my( $this ) = $class->SUPER::new( @_ ); $this->CreateMyMenuBar(); $this->CreateMyToolBar(); $this->CreateStatusBar( 1 ); $this->SetStatusText( "Welcome!", 0); # insert main window here # WDR: handler declarations for MyFrame EVT_MENU( $this, wxID_ABOUT, \&OnAbout ); EVT_MENU( $this, wxID_EXIT, \&OnQuit ); EVT_CLOSE( $this, \&OnCloseWindow ); $this; } # WDR: methods for MyFrame sub CreateMyMenuBar { my( $this ) = shift; $this->SetMenuBar( &main::MyMenuBarFunc() ); } sub CreateMyToolBar { my( $this ) = shift; my( $tb ) = $this->CreateToolBar(wxTB_HORIZONTAL|wxNO_BORDER); # &main::MyToolBarFunc( $tb ); } # WDR: handler implementations for MyFrame sub OnAbout { my( $this, $event ) = @_; Wx::MessageBox( "Welcome to SuperApp 1.0\n(C)opyright Joe Hacker", "About SuperApp", wxOK|wxICON_INFORMATION, $this ); } sub OnQuit { my( $this, $event ) = @_; $this->Close(1); } sub OnCloseWindow { my( $this, $event ) = @_; $this->Destroy(); } package MyApp; use strict; use vars qw(@ISA); @ISA=qw(Wx::App); sub OnInit { my( $this ) = @_; Wx::InitAllImageHandlers(); my( $frame ) = MyFrame->new( undef, -1, "SuperApp", [20,20], [500, +340] ); $frame->Show(1); 1; } package main; my( $app ) = MyApp->new(); $app->MainLoop();

In reply to wimpole wxperl help by gizmox

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.