sub grid { local $SIG{'__DIE__'} = \&Carp::croak; my $w = shift; if (@_ && $_[0] =~ /^(?:bbox|columnconfigure|configure|forget|info|location|propagate|rowconfigure|size|slaves)$/x) { my $opt = shift; Tk::grid($opt,$w,@_); } else { # Two things going on here: # 1. Add configure on the front so that we can drop leading '-' Tk::grid('configure',$w,@_); # 2. Return the widget rather than nothing return $w; } } #### $ perl -MTk -e '$m=tkinit; $f=$m->Frame->pack; $b=$f->Button(-text=>"Foo")->grid; $m->after(750,sub{Tk::grid("remove",$b)}); MainLoop' #### --- Widget.pm.orig 2003-08-29 14:53:46.000000000 -0500 +++ Widget.pm 2003-08-29 14:45:14.000000000 -0500 @@ -61,7 +61,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)], @@ -1060,7 +1060,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,@_);