Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, I have a problem, not matter how much i try to initiate Gtk2::SimpleList i always get this error:
Not a HASH reference at /Perl/site/lib/Gtk2/SimpleList.pm line 132.
Here's the snippet im using:
use Gtk2 qw/-init/; use Gtk2::SimpleList; $main = Gtk2::Window->new('toplevel'); $list = Gtk2::SimpleList->new('test' => 'text');
I've looked through simplelist.pm but i can't comprehend why it's throwing this error. I'm not sure if this is a bug with Gtk2-perl, or it's just something im missing totally.

Replies are listed 'Best First'.
Re: Gtk2 Simplelist
by Joost (Canon) on Jan 22, 2007 at 19:42 UTC
    Maybe your Gtk2 install is broken, your code gives no such error at my machine (but ofcourse it doesn't show anything either. The following shows the list at my install.
    use Gtk2 qw/-init/; use Gtk2::SimpleList; $main = Gtk2::Window->new('toplevel'); $list = Gtk2::SimpleList->new('test' => 'text', test2 => 'text'); $main->add($list); $main->show_all; Gtk2->main;
    (that's with Gtk2, V1.122)