in reply to slide view of a folder of JPEG's
Several changes:
use Tk; use Tk::JPEG; use File::Glob ':glob'; use constant DELAY => 1000; my @jpgs = bsd_glob("*.jpg"); my $index = 0; my $mw = MainWindow->new(title => "JPEG"); my $image = $mw->Photo(); $mw->Button(-image => $image)->pack(); $mw->after(DELAY, \&next_image); MainLoop; sub next_image { $image->blank(); if (eval {$image->read($jpgs[$index]); 1}) { $mw->configure(-title => $jpgs[$index]); $mw->after(DELAY, \&next_image) if (++$index <= $#jpgs); } else { $mw->after(0, \&next_image) if (++$index <= $#jpgs); } }
|
---|