Re: Problem with wxHTML rendering on Ubuntu LTS 10.4
Hi, Wx versions 0.95 and 0.96 are 'broken' in this respect, I think. The following 'workaround' placed in code just after 'use Wx' would fix it I and account for PAR::Packager. use Wx; if(($Wx::VERSION =~ /^(0\.95|0\.96)$/) (not exists($ENV{PAR_0}))) { *Wx::load_dll = sub { return if $^O =~ /^darwin/i; goto $load_fun; }; } On 04/05/2010 10:15, Johan Vromans wrote: Hi, On Ubuntu LTS 10.4 I experience problems with wxHTML rendering. perl-Wx version 0.96 (as distributed) Wx version 2.8.1 (as distributed) Using Wx::Demo 0.11, the Windows wxHtmlWindow Simple demo shows a window with HTML tags unprocessed: html head titleA simple HTML document/title /head body bgcolor=#ff h4A simple HTML document/h4 p Just a quick testfont color=#00Color/font /p p This is aa href=page.htmllink/a /p /body /html The other wxHtmlWindow demos show the same behaviour. libwx_gtk2u_html-2.8.so.0.6.0 is installed and available. And ideas? Suggestions? Thanks, Johan
Re: Problem with wxHTML rendering on Ubuntu LTS 10.4
Post in haste and spot the error straight away ... use Wx; if(($Wx::VERSION =~ /^(0\.95|0\.96)$/) (not exists($ENV{PAR_0}))) { *Wx::load_dll = sub { return if $^O =~ /^darwin/i; goto $Wx::load_fun; }; } On 04/05/2010 12:06, Mark Dootson wrote: use Wx; if(($Wx::VERSION =~ /^(0\.95|0\.96)$/) (not exists($ENV{PAR_0}))) { *Wx::load_dll = sub { return if $^O =~ /^darwin/i; goto $load_fun; }; }
Re: Problem with wxHTML rendering on Ubuntu LTS 10.4
Mark Dootson mark.doot...@znix.com writes: use Wx; if(($Wx::VERSION =~ /^(0\.95|0\.96)$/) (not exists($ENV{PAR_0}))) { *Wx::load_dll = sub { return if $^O =~ /^darwin/i; goto $Wx::load_fun; }; } Thanks for the speedy answer. Unfortunately, it generates some errors: Name Wx::load_fun used only once: possible typo at /usr/bin/ebwxshell line 25. Subroutine Wx::load_dll redefined at /usr/bin/ebwxshell line 26. Use of uninitialized value $Wx::load_fun in subroutine dereference at /usr/bin/ebwxshell line 25. Unable to create sub named at /usr/bin/ebwxshell line 25. Compilation failed in require at (eval 75) line 1. Apparently, Wx::load_fun is unknown or uninitialized. Where is it supposed to come from? -- Johan
Re: Problem with wxHTML rendering on Ubuntu LTS 10.4
Hi, $load_fun is in Wx.pm and should contain a reference to Wx::_load_dll Clearly I misunderstood scoping. Perhaps the following will work by just calling Wx::_load_dll directly. use Wx; if(($Wx::VERSION =~ /^(0\.95|0\.96)$/) (not exists($ENV{PAR_0}))) { no warnings; *Wx::load_dll = sub { use warnings; return if $^O =~ /^darwin/i; Wx::_load_dll( @_ ); }; } The problem is that the method Wx::load_dll() does nothing if the OS is linux. This 'breaks' Wx::Html (amongst other things). I think the code above should work. On 04/05/2010 14:48, Johan Vromans wrote: Mark Dootsonmark.doot...@znix.com writes: use Wx; if(($Wx::VERSION =~ /^(0\.95|0\.96)$/) (not exists($ENV{PAR_0}))) { *Wx::load_dll = sub { return if $^O =~ /^darwin/i; goto$Wx::load_fun; }; } Thanks for the speedy answer. Unfortunately, it generates some errors: Name Wx::load_fun used only once: possible typo at /usr/bin/ebwxshell line 25. Subroutine Wx::load_dll redefined at /usr/bin/ebwxshell line 26. Use of uninitialized value $Wx::load_fun in subroutine dereference at /usr/bin/ebwxshell line 25. Unable to create sub named at /usr/bin/ebwxshell line 25. Compilation failed in require at (eval 75) line 1. Apparently, Wx::load_fun is unknown or uninitialized. Where is it supposed to come from? -- Johan
Re: Problem with wxHTML rendering on Ubuntu LTS 10.4
[Quoting Mark Dootson, on May 4 2010, 15:11, in Re: Problem with wxH] Perhaps the following will work by just calling Wx::_load_dll directly. use Wx; if(($Wx::VERSION =~ /^(0\.95|0\.96)$/) (not exists($ENV{PAR_0}))) { no warnings; *Wx::load_dll = sub { use warnings; return if $^O =~ /^darwin/i; Wx::_load_dll( @_ ); }; } Yes this seems to work! Final question: who's to blame? Did Ubuntu just package the wrong version of wxPerl? -- Johan
Re: Problem with wxHTML rendering on Ubuntu LTS 10.4
Hi, Wx 0.96 passes all tests - so not fault of Ubuntu folks. The change was introduced in version 0.95, as I recall, in response to a user issue with PAR::Packer. I'm not sure if one could write a test that would tell you if Wx::HtmlWindow is rendering as expected. A pity that this ended up in Ubuntu LTS 10.4. It will probably trip up the Padre folks too as they use STC. The solution previously posted could perhaps be used in code that might be distributed elsewhere - though thinking about it, PAR, PerlApp etc would not work - but that probably does not matter. You could just patch Wx.pm itself if you only need a solution for one particular 'machine' The subroutine sub load_dll { return if $^O ne 'MSWin32'; goto $load_fun; } needs to be sub load_dll { return if $^O =~ /^darwin/i; goto $load_fun; } and finally - as Alien::wxWidgets is already installed, cpan Wx would get the latest version. I'm certain this is obvious to you, but thought it would be useful to have in the thread with this heading. Mark On 04/05/2010 15:17, Johan Vromans wrote: [Quoting Mark Dootson, on May 4 2010, 15:11, in Re: Problem with wxH] Perhaps the following will work by just calling Wx::_load_dll directly. use Wx; if(($Wx::VERSION =~ /^(0\.95|0\.96)$/) (not exists($ENV{PAR_0}))) { no warnings; *Wx::load_dll = sub { use warnings; return if $^O =~ /^darwin/i; Wx::_load_dll( @_ ); }; } Yes this seems to work! Final question: who's to blame? Did Ubuntu just package the wrong version of wxPerl? -- Johan
Re: Problem with wxHTML rendering on Ubuntu LTS 10.4
Hi, IF Padre has a problem with 0.95 / 0.96 on linux - you'd need to check that first - I'm just making a guess. But perhaps there isn't a problem. Come to think of it, if Johan can view the wxDemo example code displayed correctly in an STC window, then there probably isn't an issue with STC. I recall there are these sorts of problems with more than html - I just can't recall which components specifically. If there were an issue, then it seems to me the simplest thing would be to make 0.97 a requirement cpan Padre should then do the right thing. On 04/05/2010 15:56, Zeno Gantner wrote: Hi Mark, On Tue, May 4, 2010 at 4:51 PM, Mark Dootsonmark.doot...@znix.com wrote: Hi, Wx 0.96 passes all tests - so not fault of Ubuntu folks. The change was introduced in version 0.95, as I recall, in response to a user issue with PAR::Packer. I'm not sure if one could write a test that would tell you if Wx::HtmlWindow is rendering as expected. A pity that this ended up in Ubuntu LTS 10.4. It will probably trip up the Padre folks too as they use STC. Would you recommend that Padre should try to avoid 0.95 and 0.96, and maybe issue a warning (either at runtime, or when running perl Makefile.PL) if one of those versions of Wx is installed? Best regards, Zeno
Re: Problem with wxHTML rendering on Ubuntu LTS 10.4
Hi, maybe it is a problem: http://padre.perlide.org/trac/ticket/941 My guess is that this ticket has been reported by Johan ... Best, Z. On Tue, May 4, 2010 at 5:18 PM, Mark Dootson mark.doot...@znix.com wrote: Hi, IF Padre has a problem with 0.95 / 0.96 on linux - you'd need to check that first - I'm just making a guess. But perhaps there isn't a problem. Come to think of it, if Johan can view the wxDemo example code displayed correctly in an STC window, then there probably isn't an issue with STC. I recall there are these sorts of problems with more than html - I just can't recall which components specifically. If there were an issue, then it seems to me the simplest thing would be to make 0.97 a requirement cpan Padre should then do the right thing. On 04/05/2010 15:56, Zeno Gantner wrote: Hi Mark, On Tue, May 4, 2010 at 4:51 PM, Mark Dootsonmark.doot...@znix.com wrote: Hi, Wx 0.96 passes all tests - so not fault of Ubuntu folks. The change was introduced in version 0.95, as I recall, in response to a user issue with PAR::Packer. I'm not sure if one could write a test that would tell you if Wx::HtmlWindow is rendering as expected. A pity that this ended up in Ubuntu LTS 10.4. It will probably trip up the Padre folks too as they use STC. Would you recommend that Padre should try to avoid 0.95 and 0.96, and maybe issue a warning (either at runtime, or when running perl Makefile.PL) if one of those versions of Wx is installed? Best regards, Zeno
Re: Problem with wxHTML rendering on Ubuntu LTS 10.4
Mark Dootson wrote: Hi, Wx 0.96 passes all tests - so not fault of Ubuntu folks. The change was introduced in version 0.95, as I recall, in response to a user issue with PAR::Packer. I'm not sure if one could write a test that would tell you if Wx::HtmlWindow is rendering as expected. Sort of; ext/html/t/04_taghandlers.t tests this specific bug. A pity that this ended up in Ubuntu LTS 10.4. It will probably trip up the Padre folks too as they use STC. The only affected Wx module (I know of) is Wx::Html. Regards, Mattia