From: John R. <jr...@ce...> - 2007-03-01 21:06:35
|
On Mar 1, 2007, at 10:06 AM, Bob Hunter wrote: > Hello, > > I am not subscribed, so, please, Cc the answers to my > address. > > I want to port an application from perl/tk to perl/wx, > under osx, but I am having difficulties in getting > started. My environment is: > > - latest osx, > - latest apple development tools, > - latest perl > - wxWidgets 2.6.something, via above dev tool, > - wxWidgets 2.8.1, installed via > .. Alien-wxWidgets-0.27_51.tar.gz > - wxPerl 0.26 (perl binary to focus on windows) > > It runs Apple's demos. > > Now, there is a nice tutorial at IBM's site > http://www-128.ibm.com/developerworks/library/l-wxwidgets/index.h > when I try to use the included perl script, PERL says: > >> Base class package "Wx::Frame" is empty. > > if I perldoc Wx::Frame, it says > >> No documentation found for "Wx::Frame". > > if I search CPAN for Wx::Frame, it says > > http://search.cpan.org/search?query=Wx%3A%3AFrame&mode=all > > where the only relevant module is "dotReader", not > mentioned in the original article at IBM. > > Now, I have been looking around for a cut through > introduction on how to port from perl/Tk, but had no > luck so far, and the available demos are everything > but elegant, by comparison with perl/tk. What I am > looking for is to avoid using an Interface Builder; > for this to be possible, I need the code to be as > minimal as in perl/Tk. Do you have any link to > up-to-date tutorials that would do in my case? > > Thank you. > Bob The problem with the perl program at ibm (the url is http://www-128.ibm.com/developerworks/linux/library/l-wxwidgets/ btw), is that it's lacking the all-important "use Wx;". There is no Wx/Frame.pm, so the use base doesn't know to pull anything in. The version of wxPerl that you indicate, 0.26, is antique, though not as antique as the one Apple provides in Developer Tools. (You didn't get wxWidgets 2.6.0 from Developer Tools; that's version 2.5.3.) To get up to date, make sure that the wx-config for your 2.8 installation is first on your path, then get the latest wxPerl from CPAN. There are some tutorials referenced on the wxPerl page, http:// wxperl.sourceforge.net, but they're kind of old. The basics haven't changed much, so they're likely good to get you started. You'll also find an annotated version of the wxWidgets documentation there. This may be useful if you run up against something where the wxPerl API differs significantly from the C++ one; there aren't many of those, though. I also highly recommend the wxPython website (http:// www.wxpython.org). The wxPython community is much larger than that of wxPerl, and their website and wiki have lots of good material for learning Wx. Don't neglect the wxWidgets site itself, either. The API is very consistent across the three languages, so it's really easy to use advice and examples for any of them with wxPerl. Regards, John Ralls |