From: Mark D. <mar...@zn...> - 2007-02-12 03:24:34
|
After some cursory investigation, I can't actually get Wx::InternetFSHandler to work on Win32. The obvious C code doesn't work, and the obvious is pretty much all I can manage. You can get pages to load if you install Wx::Perl::FSHandler::LWP from CPAN. Then you can do: use Wx::FS; use LWP::UserAgent; use Wx::Perl::FSHandler::LWP; my $ua = LWP::UserAgent->new; my $handler = Wx::Perl::FSHandler::LWP->new( $ua ); Wx::FileSystem::AddHandler( $handler ); .......... $htmlwindow->LoadPage('http://www.google.com/'); However, as pointed out by Marcus, this still isn't particularly satisfactory as it does not handle relative urls so none of the image tags work. You could take a look at the Wx::Perl::FSHandler::LWP code and in particular the sub 'OpenFile'. If you add the following code to it: my $path = $fs->GetPath(); print qq(PATH = $path\n); print qq(LOCATION = $location\n); you'll see where the problem lies. This could probably by fixed by adding in your own custom handlers for the appropriate bits of the parser and tag handlers, but if you look at the output in wxHtmlWindow, it probably won't ever do what you require. Thanks to the efforts of Andrew on this list putting together a patch for Wx::ActiveX, I've finally included Wx::ActiveX in the unicode ppms at http://www.cava.co.uk/freetools/wxperl.html Until Wx::WebCore is ready (which sounds wonderful) IMHO your best bet for embedding on MSWin32 seems to be Wx::ActiveX. But I say that as one who has read what it is supposed to do rather than from any successful experience. Regards Mark Peter Theobald wrote: > At 01:03 PM 2/11/2007, Eric Wilhelm wrote: >>> It complains 'unable to open requested HTML document: >>> http://www.google.com' for ANY url I give it. >> Init the fs handler? > > Sorry if this seems obvious to everyone else, but... could you be a little more specific? > How does one 'init the fs handler'? > The HtmlWindow man pages don't say anything about an fs handler. > I don't see a class called Wx::FS. The closest I can find is Wx::FileSystem, but I don't see a clear connection between FileSystem and HtmlWindow. > -Peter > > >>> If I download the HTML >>> using LWP::Simple or something like it and $htmlwin->SetPage( $html) >>> it will display the page, but all the images are the same 'broken >>> image' icon. >> If broken images on SetPage, are because the images are supposed to be >> relative to the url, which is something like 'about:blank' when the >> content is loaded via SetPage. >> >> --Eric >> -- >> Introducing change is like pulling off a bandage: the pain is a memory >> almost as soon as you feel it. >> --Paul Graham >> --------------------------------------------------- >> http://scratchcomputing.com >> --------------------------------------------------- >> >> ------------------------------------------------------------------------- >> Using Tomcat but need to do more? Need to support web services, security? >> Get stuff done quickly with pre-integrated technology to make your job easier. >> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> _______________________________________________ >> wxperl-users mailing list >> wxp...@li... >> https://lists.sourceforge.net/lists/listinfo/wxperl-users > > __--=Peter Theobald=--__ > www.PeterTheobald.com > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier. > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > wxperl-users mailing list > wxp...@li... > https://lists.sourceforge.net/lists/listinfo/wxperl-users |