Skip Menu |

This queue is for tickets about the vptk_w CPAN distribution.

Report information
The Basics
Id: 40534
Status: patched
Worked: 30 min
Priority: 0/
Queue: vptk_w

People
Owner: FELIXL [...] cpan.org
Requestors: Hubert.Talbot [...] criq.qc.ca
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: vptk_w.pl - Can't call method "Subwidget" on an undefined value
Date: Thu, 30 Oct 2008 11:00:00 -0400
To: <bug-vptk_w [...] rt.cpan.org>
From: "Hubert Talbot" <Hubert.Talbot [...] criq.qc.ca>
- Windows XP SP3 - perl 5.8.8 (ActivePerl) - vptk 2.38 - Debian Gnu/Linux 2.6.25-2-686 - perl 5.10.0 - vptk 2.38 Hi, When I run vptk_w.pl from Windows, everything works well. However, from Linux, vptk_w.pl reports this error: Can't call method "Subwidget" on an undefined value at /usr/lib/perl5/Tk/Widget.pm line 779. This comes from vptk\vptk_w\EditorServices.pm, line 31 (call to RecolorTree function from SetMainPalette function). In /usr/lib/perl5/Tk/Widget.pm line 779 (RecolorTree function), there is a call with $Tk::___tk_set_palette that seems to be assigned only in setPalette function at line 728. setPalette is not called before the call to RecolorTree in SetMainPalette from EditorServices.pm. Adding a call to setPalette function before line 31 in EditorServices.pm (RecolorTree function) fixes the problem. $mw->setPalette('background', $bg_color); HTH Hubert
Tested on Perl 5.008.005, Tk 804.027, Linux 2.4 Worked like a charm. Can you downgrade your Perl version just for testing?
On Thu Oct 30 11:00:53 2008, Hubert.Talbot@criq.qc.ca wrote: Show quoted text
> - Windows XP SP3 > - perl 5.8.8 (ActivePerl) > - vptk 2.38 > > - Debian Gnu/Linux 2.6.25-2-686 > - perl 5.10.0 > - vptk 2.38 > > Hi, > > When I run vptk_w.pl from Windows, everything works well. > > However, from Linux, vptk_w.pl reports this error: > > Can't call method "Subwidget" on an undefined value at > /usr/lib/perl5/Tk/Widget.pm line 779. > > > This comes from vptk\vptk_w\EditorServices.pm, line 31 (call to > RecolorTree function > from SetMainPalette function). > > In /usr/lib/perl5/Tk/Widget.pm line 779 (RecolorTree function), there > is a call > with $Tk::___tk_set_palette that seems to be assigned only in > setPalette function at line 728. > > setPalette is not called before the call to RecolorTree in > SetMainPalette from EditorServices.pm. > > Adding a call to setPalette function before line 31 in > EditorServices.pm (RecolorTree function) fixes the problem. > > $mw->setPalette('background', $bg_color); > > > HTH > > Hubert > >
Well, the solution is primitive: apply the following patch & enjoy till official release of next version. --- vptk_w/EditorServices.pm 2006-12-11 16:58:57.000000000 +0200 +++ vptk_w/EditorServices_fixed.pm 2009-10-22 20:04:30.000000000 +0200 @@ -28,7 +28,11 @@ $mwPalette = $mw->Palette; my %new = (background=>$bg_color,foreground=>$fg_color); - $mw->RecolorTree(\%new); + # function available for Perl 5.08 - not available for 5.10 !!! + if($] <= 5.008008) + { + $mw->RecolorTree(\%new); + } # Save the options in the global variable Tk::Palette, for use the # next time we change the options. foreach my $option (keys %new)
--- vptk_w/EditorServices.pm 2006-12-11 16:58:57.000000000 +0200 +++ vptk_w/EditorServices_fixed.pm 2009-10-22 20:04:30.000000000 +0200 @@ -28,7 +28,11 @@ $mwPalette = $mw->Palette; my %new = (background=>$bg_color,foreground=>$fg_color); - $mw->RecolorTree(\%new); + # function available for Perl 5.08 - not available for 5.10 !!! + if($] <= 5.008008) + { + $mw->RecolorTree(\%new); + } # Save the options in the global variable Tk::Palette, for use the # next time we change the options. foreach my $option (keys %new)