Waldemar Biernacki <[EMAIL PROTECTED]> writes:

> Is anybody able to point me to the simple example of (rightclick)
> popup menu?

In the frame 'new' method:

    Wx::Event::EVT_RIGHT_DOWN ($self, \&OnRightClick);

then:


  sub OnRightClick {
    my ($self, $event) = @_;

    # Define Ids for menus
    use constant CTXMENU_OPEN => Wx::NewId();
    ... some more ...

    # Create the menu
    my $ctxmenu = Wx::Menu->new("");

    # Populate it
    $ctxmenu->Append(CTXMENU_OPEN,     "Details");
    ... some more ...

    # Attach events
    EVT_MENU($ctl, CTXMENU_OPEN,     &do_some_Action);
    ... some more ...

    # Display it.
    $self->PopupMenu($ctxmenu, $event->GetPosition);
  }

Hope this helps.

-- Johan

Reply via email to