I have a file that contains some information that is used to create a menu,
almost like a Recently Opened Files list. I tried using the code from the
podview,pl sample but it is not working for me. Can anyone see anything I
am doing wrong?
# define main menu
my $MainMenu = new Win32::GUI::Menu(
"&File" => "File",
" > E&xit" => "FileExit",
"&Message" => "Message",
" > &Add New" => "AddMessage",
" > &Edit" => "EditMessage",
" > &Delete" => "DeleteMessage",
" > -" => 0,
@MENUDEF,
"&Tools" => "Tools",
" > &Setup" => "Setup",
" > -" => 0,
" > Change &Password" => "ChangePassword",
"&Help" => "Help",
" > &About" => "About",
);
### I call this routine *before* I create my menu.
sub getMessageList {
### stuff deleted, this section just read in the file and created the has
### now I want to use the values in the hash for my menu.
@MENUDEF = ();
foreach $key (keys (%MESSAGE)) {
print "$key is text: $MESSAGE{$key}\n"; ## this is only for testing
purposes to make
## sure I have the right
information
push(@MENUDEF," > $key");
push(@MENUDEF,"Menu$key");
$subname = "Menu${key}_Click";
*$subname = eval(qq(
sub {
print "got a click\n"; ## this is for testing, but
I don't get a click
$MainWindow->Message->Text($MESSAGE{$key});
return;
}
));
}
return;
}
Jonathan