From: Peter T. <peter@PeterTheobald.com> - 2002-11-30 16:55:39
|
<html> <font size=3>(slaps forehead) 'Doh!'<br> Thanks!<br><br> At 09:06 PM 11/29/2002 -0800, DH wrote:<br> <blockquote type=cite class=cite cite>try<br><br> Wx::StaticBox->new( ... )<br><br> instead of <br><br> Wx::StaticBox( ... )<br><br> --- Peter Theobald <peter@PeterTheobald.com> wrote:<br> > Hi all,<br> > I am trying to use wxPerl because I like the way wxWindows looks and behaves better than<br> > Tk (I am mostly programming for windows systems). I made a very simple test program, but right<br> > off the bat I ran into trouble.<br> > I get an error loading 'StaticBox':<br> > <br> > Error while autoloading 'Wx::StaticBox' at demoframe.pl line 26<br> > <br> > When I looked in /perl/site/lib/wx I see there IS no StaticBox.pm. The "empty frame" demo works<br> > fine, so I know I installed wxPerl. I have downloaded and installed the latest ppm binary (First<br> > I tried wxPerl 0.11, then upgraded to 0.12b)<br> > Am I missing something simple here?<br> > <br> > My source is below. It is the simple empty frame demo with the addition of:<br> > my( $retailerlisttitle) = Wx::StaticBox( $frame, -1, "Retailer Data in file",<br> > [0,0], [100,100], wxSTATIC_BORDER, 'static box');<br> > <br> ><br> ------------------------------------------------------------------------------------------------------------------------------<br> > # this forces you to predeclare every variable, it isn't necessary,<br> > # but avoids some common mistakes (especially typos)<br> > use strict;<br> > <br> > # import the Wx module<br> > use Wx;<br> > <br> > # every application must create an application object<br> > package MyApp;<br> > <br> > # this tells Perl that your class (MyApp in this case) is derived from Wx::App<br> > use vars qw(@ISA);<br> > @ISA = qw(Wx::App);<br> > use Wx qw(:everything);<br> > <br> > # this method is called automatically when an application object is first<br> > # constructed, all application-level initialization is done here<br> > sub OnInit {<br> > # retrieve the 'this' object<br> > my( $this ) = shift;<br> > <br> > # create a new frame (a frame is a top level window)<br> > my( $frame ) = Wx::Frame->new( undef, -1, 'wxPerl demo',<br> > [100, 100], [200, 150]<br> > );<br> > my( $retailerlisttitle) = Wx::StaticBox( $frame, -1, "Retailer Data in file",<br> > [0,0], [100,100], wxSTATIC_BORDER, 'static box');<br> > <br> > # tell wxWindows to terminate when the main frame is closed<br> > $this->SetTopWindow( $frame );<br> > <br> > # show the frame<br> > $frame->Show( 1 );<br> > }<br> > <br> > package main;<br> > <br> > # create the application object<br> > my( $app ) = MyApp->new();<br> > # this function will not return until<br> > # the last frame is closed<br> > $app->MainLoop();<br> > <br> > <br> > <br> > <br> > -------------------------------------------------------<br> > This SF.net email is sponsored by: Get the new Palm Tungsten T <br> > handheld. Power & Color in a compact size! <br> > <a href="http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en" eudora="autourl">http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en</a><br> > _______________________________________________<br> > wxperl-users mailing list<br> > wxp...@li...<br> > <a href="https://lists.sourceforge.net/lists/listinfo/wxperl-users" eudora="autourl">https://lists.sourceforge.net/lists/listinfo/wxperl-users</a><br><br> <br> __________________________________________________<br> Do you Yahoo!?<br> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.<br> <a href="http://mailplus.yahoo.com/" eudora="autourl">http://mailplus.yahoo.com</a></font></blockquote><br> </html> |