osdir.com
mailing list archive

Subject: Re: Another newbie stumbling block - msg#00069

List: lang.perl.wxperl

Date: Prev Next Index Thread: Prev Next Index
Hi,

I had started work on the basis of an updated tutorial. The idea is to
provide example code for each chapter and give the thing a natural
progression adding bits to a small 'applet'.

I thought I could cover all dialogs, file dialogs, general events etc
with a simple text editing app.
Then go on to cover Wx::TreeCtrl, Wx::ListView and some threaded
'process' controlling via an 'explorer' type app. (Though I've not
decided what to 'explore' yet.

Not a word is written yet. I have only written example code for the
first six chapters of topics I'd intend covering. I also got
side-tracked with work that will remain fairly hectic till end of March.

Its aimed at development on Win32 as I figured that is where a basic
tutorial would serve the greatest audience. Example_6 is incomplete.

You can download the example code from
http://wxperl.gigi.co.uk/downloads/wxPerlTutorial.zip

I'd really appreciate any comments on coding style etc - remembering
that it is aimed at inexperienced users.

Many Thanks

Mark




Mattia Barbon <mattia.barbon@xxxxxxxxx> wrote:
> Hello,
>
>> I saved the code and upon running it (under ActivePerl 5.8.3, wxPerl
>> 0.26, wxWindows 2.6.2) I was greeted by a message that said that the
>> 'Wx::Image' module could not be found. After thinking about that for a
>> while I decided (however little I may know about wrapping libraries)
>> that perhaps this was no longer necessary and the class would now be
>> included in 'use Wx'. I'm afraid this hurdle would prove to be fatal for
>> many Perl programmers wanting to try out wxPerl.
>
> This is an error in the tutorial... the fact that Wx::Image had
> a .pm module was just an implementation detail.
>
>> Then a fairly unclear message told me that I had to change the image
>> filename that was buried somewhere in the code. Did that.
>
> A bug in the tutorial, I suppose?
>
>> Then I was greeted by the following:
>>
>> Can't locate object method "ConvertToBitmap" via package "Wx::Image" at
>> S:\peter
>> \My Documents\Perl\imagedemo.pl line 53.
>
> A wxWidgets 2.4 method that was deprecated and removed.
> The tutorial should use Wx::Bitmap->new( $image ) (or something similar,
> I am writing this off-the-top of my head).
>
>> I give up. Should it really be this difficult to run a tutorial for
>> newbies?
>
> Nope: the tutorial should be fixed.
>
> Regards
> Mattia
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642
> _______________________________________________
> wxperl-users mailing list
> wxperl-users@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/wxperl-users




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642


Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re:The sorry state of wxPerl (Wiki)

Hello, > I have the feeling that wxPerl is not getting the acceptance that it > deserves. An important factor in this is the lack of documentation. For > most stuff the only source of info is the wxWidgets documentation, which > is not always clear wrt wxPerl. The trouble is that nobody is going to rewrite a 2000 printed pages manual. Which constantly grows and is extended. > As a new wxPerl user I mostly made do with the samples and demo. If I > needed something that wasn't in there, bad luck. My minor struggle with > Wx::SingleInstanceChecker may serve as an example for the problems new > users will probably find very frustrating. The answer below is not written just to you, but to anybody willing to contribute: Once you figure out something, you might contribute your newly-acquired knowledge in the wiki. It would be great if instead or in addition to documenting it in the Wiki, everybody added example code to the demo/samples. As for the documentation: I do not think that I will ever be given permission to extensively edit wxWidgets docs to add more intrusive wxPerl documentation. The only answer for now seems to put the documentation in the wiki. Regards Mattia P.S.: only 12 minutes battery left... sorry if this is written in a hurry :-/ ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642

Next Message by Date: click to view message preview

Re: The sorry state of wxPerl (Wiki)

On Feb 20, 2006, at 6:18 AM, Marcus wrote: An important factor in this is the lack of documentation. I have to agree with you on this. A few examples of my own: - The wx docs often state "not implemented in wxPerl" when something is. If I knew where to find the info then I would gladly correct the docs for wxPerl. Quite often, it seems only Mattia will know the exact syntax. I am not a C (Perl XS) programmer, so how do I found out? You're exaggerating. "Not implemented" and "wxPerl" occur together exactly once in the wx documentation. (For the curious, it's wxDC::DrawPolyPolygon, and there's a wxPython note that says the same.) To answer the question, though, you don't really need to be an XS or C programmer to understand most wxPerl function calls. The xs code looks something like void wxDC::CrossHair( x, y ) wxCoord x wxCoord y Which tells you that it's wrapped and what the args are. Often that's all that XS needs. It looks up wxCoord in the typemap file, generates code to do whatever transformation is in there (in this case it's just a passthrough, but it does take some understanding of XS to figure that out sometimes) and sends the result on to the function. The "void" line before the function name means that this one doesn't return anything. For functions that do, XS generates code (again using the typemap) to convert the C return value back into something perl can use, and return it. There is sometimes additional XS code after the function definition, but you don't need to worry about that if you're just trying to figure out which versions of a function are wrapped. Now, I said "most wxPerl calls" above. The catch is that Mattia has a way to implement overloading (which perl doesn't normally do) and it can be a little opaque. Here's an example from Panel.xs: void new( ... ) PPCODE: BEGIN_OVERLOAD() MATCH_VOIDM_REDISP( newDefault ) MATCH_ANY_REDISP( newFull ) END_OVERLOAD( "Wx::Panel::new" ) The important thing to notice in here is that "newDefault" and "newFull" are XS functions, and to see which versions of the constructor are called, you need to look at their argument lists. I'd agree that wx is not an end-user desktop app, but that goes without saying. I read a blog by a fellow Perl programmer who was switching to wxPython because wxPerl didn't seem to be "getting anywhere". That is due to the status of the docs and sample code, because wxPerl is actually great. Only newbies get bogged down at the beginning. We need to change that. - The wiki site has been down most of the time I tried to access it recently. Can't we find a new host? The wiki is generously hosted by Jouke Visser on his pVoice host. He seems not to consider its care and feeding a priority, and the machine often appears to be loaded with other work. Conventionally, someone else would have to volunteer bandwidth, storage, and admin time and open a competing (or convince Jouke to take his down) wiki... But another sourceforge project (FreeMind) has a wiki running as their sourceforge homepage. If Mattia could find time to figure out how that's done, and to implement it, the bandwidth and machine cycles problem would be solved. It would also allow someone else with more time to be delegated admin authority for the web page. - Yesterday I was trying to create a progress dialog. The only way I could find out whether Wx::ProgressDialog was implemented was to search the mailing list, and the demo source code. Those were the only ones, but I was lucky. In other cases you are plain out of luck. In other cases I grep on the function name in the source directory. - I also wanted to know whether I could use animated GIFS, but I could not find any references to the animation contrib yet. - I made an educated guess yesterday at using Wx::SafeYield, but a newbie would unlikely derive that usage from the wx docs. The examples for C++ are quite different, and I read the wx mailing list archives first. So, how should we organise this so it is easy to update wxPerl specific docs and give sample code? It's easiest to do this while you are programming. Marcus The wxPerl WiKi has places for both amplifying documentation and code samples. wxWidgets has a mechanism for submitting documentation patches (if you want to add a "wxPerl Note" to a page in the main documentation), but I don't know if they'd want wxPerl related items to come via Mattia. Regards, John Ralls ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

Previous Message by Thread: click to view message preview

Re:Another newbie stumbling block

Hello, > I saved the code and upon running it (under ActivePerl 5.8.3, wxPerl > 0.26, wxWindows 2.6.2) I was greeted by a message that said that the > 'Wx::Image' module could not be found. After thinking about that for a > while I decided (however little I may know about wrapping libraries) > that perhaps this was no longer necessary and the class would now be > included in 'use Wx'. I'm afraid this hurdle would prove to be fatal for > many Perl programmers wanting to try out wxPerl. This is an error in the tutorial... the fact that Wx::Image had a .pm module was just an implementation detail. > Then a fairly unclear message told me that I had to change the image > filename that was buried somewhere in the code. Did that. A bug in the tutorial, I suppose? > Then I was greeted by the following: > > Can't locate object method "ConvertToBitmap" via package "Wx::Image" at > S:\peter > \My Documents\Perl\imagedemo.pl line 53. A wxWidgets 2.4 method that was deprecated and removed. The tutorial should use Wx::Bitmap->new( $image ) (or something similar, I am writing this off-the-top of my head). > I give up. Should it really be this difficult to run a tutorial for > newbies? Nope: the tutorial should be fixed. Regards Mattia ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642

Next Message by Thread: click to view message preview

Re: Another newbie stumbling block

Hi Mark, On Mon, 20 Feb 2006 19:47:27 +0000, "Mark Dootson" <mark.dootson@xxxxxxxx> said: > Hi, > > I had started work on the basis of an updated tutorial. The idea is to > provide example code for each chapter and give the thing a natural > progression adding bits to a small 'applet'. > > I thought I could cover all dialogs, file dialogs, general events etc > with a simple text editing app. > Then go on to cover Wx::TreeCtrl, Wx::ListView and some threaded > 'process' controlling via an 'explorer' type app. (Though I've not > decided what to 'explore' yet. > > Not a word is written yet. I have only written example code for the > first six chapters of topics I'd intend covering. I also got > side-tracked with work that will remain fairly hectic till end of March. > > Its aimed at development on Win32 as I figured that is where a basic > tutorial would serve the greatest audience. Example_6 is incomplete. > > You can download the example code from > http://wxperl.gigi.co.uk/downloads/wxPerlTutorial.zip > > I'd really appreciate any comments on coding style etc - remembering > that it is aimed at inexperienced users. It looks great. This kind of thing is badly needed I even recognized a familiar looking piece of single instance detection code in there ;) Regards, Peter ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by