deleting item from ListCtrl by pop-up menu

Discussion in 'Python' started by sendhil kumar, May 29, 2006.

  1. 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
     
    sendhil kumar, May 29, 2006
    #1
    1. Advertising

  2. sendhil kumar wrote:
    > 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
     
    Scott David Daniels, May 29, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Piet
    Replies:
    0
    Views:
    550
  2. John Taylor
    Replies:
    1
    Views:
    891
    Remi Villatel
    Oct 8, 2004
  3. Fabio Pliger

    wx ListCtrl with combobox...

    Fabio Pliger, Jun 11, 2005, in forum: Python
    Replies:
    0
    Views:
    601
    Fabio Pliger
    Jun 11, 2005
  4. Todd7
    Replies:
    2
    Views:
    8,334
    Todd7
    Nov 17, 2005
  5. Laszlo Nagy
    Replies:
    0
    Views:
    474
    Laszlo Nagy
    Jul 20, 2006
Loading...

Share This Page