deleting item from ListCtrl by pop-up menu

sendhil kumar sendha_vin at yahoo.com
Mon May 29 02:26:08 EDT 2006


hi all,
i need more information on the EVT_LIST_DELETE_ITEM()
for a list ctrl! iam not able to delete the selected
list item from the popup menu...below i have given the
part of the code ... im using popup menu... wher am i
wrong.... any suggestions wud b of great help...


list.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, 
self.OnRightClick)
def OnRightClick(self, event):
        # Pop Up Menu Initialisation
        self._menu_popup = wx.Menu()
        [
            self._ID_MENU_POPUP_DELETE,
        ] = [wx.NewId() for i in range(2)]
        
        'Pop Up Menu'
        self.Bind(wx.EVT_MENU, self.OnPopupDelete, id
= self._ID_MENU_POPUP_DELETE)      
      
self._menu_popup.Append(self._ID_MENU_POPUP_DELETE,
'Delete')
        
        self.PopupMenu(self._menu_popup)
        self._menu_popup.Destroy()

def OnPopupDelete(self, event):
        self.Bind(wx.EVT_LIST_DELETE_ITEM,
self.OnDelete)
        
    def OnDelete(self):
        print "Del"
        self.remove()


thanx in advance,
SendhilKumar B.Tech

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Python-list mailing list