deleting item from ListCtrl by pop-up menu


S

sendhil kumar

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
 
Ad

Advertisements

S

Scott David Daniels

sendhil said:
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...

This is a wxPython question, not a Python question.
Ask on the wxPython group. Available on gmane as
gmane.comp.python.wxpython

--Scott David Daniels
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top