Title: More on Gtk2
Greg wrote:
Ok, so I moved on to another problem with my Gtk2
script. This time I'm trying to use Simplemenu.pm to build simpler menus.
By now I've wasted more time than I've saved, but there is a lesson in here
somewhere!
I get an error that says: Can't use an
undefined value as an ARRAY reference at C:/Perl/site/lib/Gtk2/SimpleMenu.pm
line 99.
The relevant code is below (look between the ##
for the real details). I assume it has to do with how the variable is
referenced, but am somewhat ignorant of this in Perl.
(For those who care, I'm modifying NagiosWatch to run
on Win32 & use Gtk2)
As always, thanks for the help.
I think you just need to change item to children in your menu
tree.
I looked at the SimpleMenu.pm, and it calls for itms->{children}
on line 99 , not items. I don’t have Gtk2 on my machine so this is
untested.
# 99 for( $i = 0; $i < scalar(@{$itms->{children}}); $i
+= 2)
###
$menu_tree
= [
_File => {
item_type =>
'',
children => [
_New
=> {
callback => \&m_File_Exit,
callback_action => $action++,
},
_Exit
=> {
callback => \&m_File_Exit,
callback_action => $action++,
},
],
}
];
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs