"Octavian Rasnita" <orasn...@gmail.com> writes:

> Please tell me how to get the ID of the command that should execute a
> certain function.
> I've seen only examples when Escape is used for closing a window, but
> I need it for executing a certain function.

Something like this:

    use constant MENU_FILESTOP => Wx::NewID();
    ...
    $self->{FileMenu}->Append(MENU_FILESTOP, t("S&top\tEsc"));
    ...
    my $accelerator = Wx::AcceleratorTable->new
      ([wxACCEL_NORMAL, WXK_ESCAPE, MENU_FILESTOP]);
    $self->SetAcceleratorTable( $accelerator );

HTH,
        Johan

Reply via email to