From: Michael B. <mbl...@mc...> - 2005-04-14 14:33:16
|
Thank you for the tutorial. I see now that because I was not loading the Wx::Print module, neither the reference to wxPAPER_LETTER nor SetPaperId was working. When that wasn't working, I tried other approaches. Another IDtenT error. So I can avoid this sort of problem in the future, what should my generic thought process have been so I would know to use Wx::Print? There were no references to PrintData or PageSetupDialogData in Print.pm although I did see Wx::PrintDialog and Wx::GenericPageSetupDialog. I had gone and looked at the wxWidget source for references to SetPaperId, wxPAPER_LETTER and others to see what I was missing. In addition, the HtmlEasyPrinting was working except for the paper size. With all the subclassing. AUTOLOADing and EXPORTing that is happening, it is hard to know in what context the explicit use of a module is necessary. When in doubt I suppose that I could load every WxPerl module. Every day that I work with wxWidgets and WxPerl, I become more appreciative of their power and the work that went into them. Thanks again for your help. MCB -----Original Message----- From: wxp...@li... [mailto:wxp...@li...] On Behalf Of Mattia Barbon Sent: Wednesday, April 13, 2005 3:35 PM To: mcb...@mc...; Michael Blakeslee; wxp...@li... Subject: Re: [wxperl-users] How to troubleshoot when using WxPerl? On Wed, 13 Apr 2005 14:04:18 -0500 Michael Blakeslee <mbl...@mc...> wrote: Hello, > In my learning process with WxPerl and wxWidgets I have been wondering what > the best way to troubleshoot is? It depends on the source of the problem. The first step is having a minimal example (as you provided), from there on I do not think there is a "best" strategy. > For instance, I was using Wx::HTMLEasyPrinting to print some HTML. Since I > am in the US I needed to change the default paper size to letter from A4. I > used both Wx::HTMLEasyPrinting::GetPrintData and > Wx::HTMLEasyPrinting::GetPageSetupData to get a pointer to the wxPrintData > or wxPageSetupDialogData instance. I attempted to use SetPaperSize and > SetPaperId to change the A4 default. Event though the correct instance type > was indicated when using the debugger, there was no SetPaperSize or > SetPaperId method available. I eventually just put in a menu item to invoke > Wx::HTMLEasyPrinting:PageSetup to make the changes, but would like to be > able to change the printing parameters without user intervention. In this case, after discovering the object was the correct instance, you should have reported on the list; I would have answered that I can see the methods you mention in both class sources, I would have tried what you see below C:\>perl -MWx -MWx::Print -e "print Wx::PrintData->new->GetPaperId" 3 C:\>perl -MWx -MWx::Print -e "print Wx::PageSetupDialogData->new->GetPaperSize" Wx::Size=SCALAR(0x15d5208) C:\> and I would have asked for a minimal sample, then I would have realized it is attached below ;-). If it turns out to be a wxPerl bug it will eventually be fixed. In this case you just forgot/did not know to add use Wx::Print; somewhere, plus in the example below SetPaperSize is a method of Wx::PageSetupDialogData, not Wx::PrintData (but I believe your real code calls them correctly). > Put code below to illustrate above problem. The eval in OnPrint will throw > an error that is printed in the console window. > > I have tried to find a way to get the methods available for a give object > but don't know how to do it or whether it is possible. I imagine there is a > symbol table somewhere, but I also realize that this is perl interfacing > with a C++ generated DLL. Just use the Standard Perl Way: perl -MWx -MWx::Print -e "print join qq{\n}, keys %Wx::PrintData::" > Would be interested in helping with development that is needed in WxPerl, > but would like to understand better how it is hooked into wxWidgets. Is > there any higher-level documentation than the code that would shed light on > this? No, there is not. There are some posts somewhere in the ML archives... HTH Mattia ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ wxperl-users mailing list wxp...@li... https://lists.sourceforge.net/lists/listinfo/wxperl-users |