hill has asked for the wisdom of the Perl Monks concerning the following question:
After posting an initial question wondering about a useful image viewer, I was vectored off to look at the Perl Tk and presented with an example script that worked a treat. However, in the search for a less capable (and therefore smaller and less complex) piece of code, I cobbled together the script shown below.
(This is a good place for a disclaimer—I know next to nothing about Perl Tk and still consider myself a Perl duffer even with a couple of years of medium intensity experience.)
In any case, this code isn’t quite there. I would like it to display an image then over write it with a subsequent image. This actually displays an image and writes the next image below the previous one (not behind the current image, below it on the monitor) with each subsequent image drawn, I suppose, further down and out of sight. This is running on a Windows machine using Active State Perl.
Many thanks, folks.
#!/usr/local/bin/perl use Tk; use Tk::Photo; $mw = new MainWindow; $mw -> geometry ("820x780"); @files = <*gif>; for $image (@files) { $shot = $mw->Photo(-file => "$image"); $mw->Button(-image => $shot)->pack(); $mw->update; select(undef, undef, undef, .1); } $mw->MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Image in Perl TK?
by zentara (Cardinal) on Dec 19, 2008 at 19:37 UTC | |
|
Re: Image in Perl TK?
by hominid (Priest) on Dec 19, 2008 at 18:58 UTC | |
by zentara (Cardinal) on Dec 19, 2008 at 19:39 UTC | |
|
Re: Image in Perl TK?
by dk (Chaplain) on Dec 19, 2008 at 19:45 UTC | |
by Anonymous Monk on Jul 28, 2017 at 22:28 UTC |