From: "Glenn Linderman" <[EMAIL PROTECTED]>

> > Does anyone have an example of using the Change() method (or another
way)
> > for modifying the text that appears in the menus?
>
>    $m_config->{'sGetDataDir'}->Change( -text =>
>      "&reset data directory ($datadir)" );
>
> where $m_config is the configuration menu, sGetDataDir is one entry in
> that menu, and this supplies new text, as well as a new hotkey character
> for the text.
>

Hi,

I have tried the following test program, but it doesn't work. After choosing
the "Test" option menu, the program should change the "File" menu to
"Something" but it doesn't do it.


use strict;
use Win32::GUI;

my $Menu = Win32::GUI::MakeMenu(
"&File" => "File",
"> &Test" => {-name => "Test", -onClick => \&test},
);

my $Win = Win32::GUI::Window->new(
-title => "Test",
-pos => [100, 100],
-size => [400, 400],
-menu => $Menu,
-dialogui => 1,
);

$Win->Show();
Win32::GUI::Dialog();

sub Win_Terminate{-1}

sub test {
$Menu->{File}->Change(-text => "Something");
$Win->InvalidateRect(1);
}


Teddy


Reply via email to