#!/usr/bin/perl -- ## ## 2014-06-09-12:49:11 ## ## ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if " -otr -opr -ce -nibc -i=4 -pt=0 "-nsak=*" #!/usr/bin/perl -- use strict; use warnings; use Tk; use Tk::Table; Main( @ARGV ); exit( 0 ); sub Santeria { my( $w ) = @_; #~ my( $w , $table ) = @_; my $table = $w->parent; $_->configure( -background => 'white' ) for $table->children; my( $row, $col ) = $table->Posn( $w ); print "row=$row, col=$col\n"; $w->configure( -background => 'grey' ); } ## end sub Santeria sub Main { my $mw = MainWindow->new; my $table = $mw->Table->pack; for my $iy ( 0 .. 5 ){ for my $ix ( 0 .. 5 ) { $table->put( $ix, $iy, "x($ix),y($iy)" ); } } #~ $table->bind( 'Tk::Label', '<1>', [ \&Santeria, $table ] ); $table->bind( 'Tk::Label', '<1>', \&Santeria ); #~ use Tk::WidgetDump; $mw->WidgetDump; MainLoop; } ## end sub Main __END__