use strict; use Tk; use Tk::Button; require Tk::Photo; my $top = new MainWindow; my $myimage = $top->Photo(-format=>'bmp',-file=>"image/images2.bmp", -height=> 50, -width => 50); for my $x (1..10) { for my $y (1..10) { my $button = $top->Button(); $button = $top->Button(-width => 5, -height=>2, -command => sub {check_status($x,$y)}); $button->grid(-column=>$y,-row=>$x); } } sub check_status() { my ($myx,$myy)=@_; ######### What to Write ??? #### ################################ } MainLoop