[wxPython] popup a pull down menu

Hi All,

I try to create a pulldown menu, for right cilck event in TreeCtrl.
See the below lines of code. I've created the menu, but menu.Show(TRUE) is
throughing invalid Attribute error.

1) How can one popup created menu at event.GetPosition() point?
2) do one need to call return after, Skip() call

···

__
def onTreeRightDown(self,event):
        pt = event.GetPosition();
        item, flags = self.HitTest(pt)
        print flags
        if flags != wxTREE_HITTEST_ONITEMLABEL:
            event.Skip()
            return
  
        self.SelectItem(item)
        
        menu = wxMenu()
        menuitem = wxMenuItem(menu,-1, 'Rename', '')
        menu.AppendItem(menuitem)
        EVT_MENU(self, menuitem.GetId(), self.onItemRename)
        #menu.Show(TRUE)
        
    def onItemRename(self,event):
        pass

_______

I try to create a pulldown menu, for right cilck event in TreeCtrl.
See the below lines of code. I've created the menu, but menu.Show(TRUE) is
throughing invalid Attribute error.

1) How can one popup created menu at event.GetPosition() point?

    self.PopupMenu(menu, pos)

2) do one need to call return after, Skip() call

If you want to return from the handler at that point, then yes.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!