Subject: | Tk::Widget doesn't support gridRemove method as documented |
Call $widget->gridRemove() on Debian squeeze with install of Tk from
CPAN fails with:
XS_Tk__Callback_Call error:Failed to AUTOLOAD 'Tk::Label::gridRemove' at
./timer2.pl line 97
Tk::Error: Failed to AUTOLOAD 'Tk::Label::gridRemove' at ./timer2.pl line 97
Carp::croak at /usr/share/perl/5.10/Carp.pm line 44
Tk::Widget::__ANON__ at /usr/lib/perl5/Tk/Widget.pm line 347
With the attached patch applied, the call succeeds and appears to work.
Thanks to perlmonks (http://www.perlmonks.org/?node_id=287771) for this
solution.
Subject: | Widget.pm.patch |
--- Widget.pm 2010-01-31 06:25:11.000000000 +1300
+++ /usr/lib/perl5/Tk/Widget.pm 2011-02-19 18:35:32.000000000 +1300
@@ -63,7 +63,7 @@
use Tk::Submethods( 'grab' => [qw(current status release -global)],
'focus' => [qw(-force -lastfor)],
'pack' => [qw(configure forget info propagate slaves)],
- 'grid' => [qw(bbox columnconfigure configure forget info location propagate rowconfigure size slaves)],
+ 'grid' => [qw(bbox columnconfigure configure forget info location propagate remove rowconfigure size slaves)],
'form' => [qw(check configure forget grid info slaves)],
'event' => [qw(add delete generate info)],
'place' => [qw(configure forget info slaves)],
@@ -1225,7 +1225,7 @@
{
local $SIG{'__DIE__'} = \&Carp::croak;
my $w = shift;
- if (@_ && $_[0] =~ /^(?:bbox|columnconfigure|configure|forget|info|location|propagate|rowconfigure|size|slaves)$/x)
+ if (@_ && $_[0] =~ /^(?:bbox|columnconfigure|configure|forget|info|location|propagate|remove|rowconfigure|size|slaves)$/x)
{
my $opt = shift;
Tk::grid($opt,$w,@_);