Hi everyone,
I'm trying to use the Tk:hoto class, but the documentation
is very scarse. All I can find is
http://search.cpan.org/dist/Tk/pod/Photo.pod
with it's strange syntax like
$widget->Photo(?name??, options?)
and no examples of use at all.
The following code works, but I have no idea why I must
put the Photo into a Label :
Anyone knows a friendlier intro to Tk:hoto ?
A cookbook maybe ?
As the Perl doc often reminds me, I'm a poor loser
forced to program on a Win32 box... )
Thanks for any help !
I'm trying to use the Tk:hoto class, but the documentation
is very scarse. All I can find is
http://search.cpan.org/dist/Tk/pod/Photo.pod
with it's strange syntax like
$widget->Photo(?name??, options?)
and no examples of use at all.
The following code works, but I have no idea why I must
put the Photo into a Label :
Code:
use Tk;
use Tk::JPEG;
my $MW = new MainWindow;
$MW ->Label(-text => 'Tk Photo')->pack;
$image_tk = $MW->Photo('img', -format=>'jpeg',
-file => "c:/someimage.JPG");
$MW->Label(-image => $image_tk)->pack(-side=>'left');
$MW->Button(-text => 'exit',
-command => sub{exit} )
->pack(-side => 'bottom');
MainLoop;
Anyone knows a friendlier intro to Tk:hoto ?
A cookbook maybe ?
As the Perl doc often reminds me, I'm a poor loser
forced to program on a Win32 box... )
Thanks for any help !