Hi,
When you use a string as an accelerator function name, it's call
_Click event.
It's not try to call an "S3" sub but an "S3_Click" Sub.
Just change :
sub S3 { $W->Caption("Shift-3"); }
By :
sub S3_Click { $W->Caption("Shift-3"); }
And it's work ;o)
Laurent.
PS : From last
The docs suggest "Shift-3" should work but in fact you need a reference!
snip--->
use Win32::GUI;
$A = new Win32::GUI::AcceleratorTable(
"Shift-1" => \&S1,
"Shift-2" => sub { $W->Caption("Shift-2"); },
"Shift-3" => "S3",
);
$W = new Win32::GUI::Window(-accel => $A,
2 matches
Mail list logo