Pete,

Yes! Thank you!  I didn't realize it would be that easy.

Thanks,

Jonathan

At 6/19/2002 12:31 PM, you wrote:

Try this... is this what you mean?

-Pete
##########################
#!perl -w

use Win32::GUI;
use strict;

my $counter=1;

my $Menu = new Win32::GUI::Menu(
 "&File" => "File",
 "   >   &Counter $counter..." => "Counter",
);

my $MW = new Win32::GUI::Window(
    -title   => 'menu.pl',
    -left    => 100,
    -top     => 100,
    -width   => 150,
    -height  => 100,
    -name    => 'MainWindow',
    -visible => 1,
    -menu    => $Menu,
);

$MW->AddButton(
    -text    => 'change menu',
    -name    => 'menu',
    -left    => 25,
    -top     => 25,
);

Win32::GUI::Dialog();


sub MainWindow_Terminate
{
 return -1;
}

sub menu_Click
{
 &counteradd();
}

sub Counter_Click
{
 &counteradd();
}

sub counteradd
{
 $counter++;
 print "DEBUG: counter = $counter\n";

 my $Menu = new Win32::GUI::Menu(
  "&File" => "File",
  "   >   &Counter $counter..." => "Counter",
 );
 $MW->Change(-menu => $Menu);
}

### END


-----Original Message-----
From: Jonathan Southwick [mailto:jsouthwi@allegheny.edu]
Sent: Wednesday, June 19, 2002 10:04
To: perl-win32-gui-users@lists.sourceforge.net
Subject: RE: [perl-win32-gui-users] another menu question

I meant I want them to be able to access the NEW menu items without restarting the script.

Jonathan

At 6/19/2002 09:59 AM, you wrote:

The results are already stored to the ini file so that when they run the script the next time they will have the menu items available to them.  The ini file is read in and the 'Message' section of the menu is created on startup of the script.

I want them to be able to access the menu items without having to restart the script.  Is it possible to do this?

Jonathan

At 6/19/2002 09:35 AM, you wrote:

Depends on what you want to happen. Do you want their changes to be saved to the .ini file or should the changes only last for that session. My suggestion is that you localize the building of the menu after they've made their edit (maybe a button event?) and store the shortcut/description relationship in a hash and write (or don't write) it to the .ini after the edit.

Another way to do it would be the brute force method, where they make the changes, save to .ini, and then restart the script (exec script.pl).

Jonathan Southwick
jsouthwi@allegheny.edu
Technical & Network Services
Allegheny College, Meadville, PA 16335
(814) 332-2755