use Tk; use Tk::Thumbnail; ## GLOBALS my $mw; my $thumb; ## Subroutines sub thumb_cmd { my ( $widget, $filename, $is_bad, $pix_width, $pix_height, $frames ) = @_; if ($is_bad) { print "IS INVALID IMAGE\n"; return; }else{ print "Valid Image.\n"; print "Thumbnail information:\n"; print "\tFilename: [$filename]\n"; print "\tWidth: $pix_width\n"; print "\tHeight: $pix_height\n"; ## I Tried adding code that modified ## options of $widget... ## ie... $widget->configure( -relief => 'raised' ); return; } } sub init { my @img = ( <*.jpg>, <*.bmp> ); $mw = MainWindow->new; $thumb = $mw->Thumbnail( -images => \@img, -ilabels => 1, -iheight => 75, -iwidth => 75, -command => \&thumb_cmd, )->pack; } ## MAIN init; MainLoop;