I'm a pretty total newbie to Tk, and I wanted to play with JPEG support. I searched CPAN and checked out Tk::JPEG, which seemed suited for my purposes. So I installed it, read the Tk documentation and tried to write a small script which will display the file 'test.jpg'. However, when I tried to run this:
use strict;
use warnings;
use Tk;
use Tk::JPEG;
my($main_window);
$main_window = MainWindow->new();
$main_window->Photo(-format => 'jpeg', -file => 'test.jpg')->pack;
MainLoop;
I was greeted with the fateful words:
'wrong # args: should be "pack option arg ?arg ...?" at tk.pl line 9.'
Not to be put off, I tried specifying more arguments to the pack function., specifically
'-side => 'bottom'' and
'-expand => 1'.
Rather annoyingly, this caused the following incomprehensible error message:
'bad option "image1": must be configure, forget, info, propagate or sl
+aves at tk.pl line 9'
Removing either of the arguments furnished no solution. The most helpful thing someone could do here would just be to post a very basic chunk of Tk::JPEG using code, that I could learn from. I expect it's something really simple I'm missing here, but hey, better to ask and be a fool for five minutes...