473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

deleting item from ListCtrl by pop-up menu

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
May 29 '06 #1
1 2369
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
sc***********@acm.org
May 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Fabio Pliger | last post by:
Hi all, i'm working on a very large project using wx 2.5... On one frame i have a wx.lib.mixins.listctrl widget, wich is a listctrl extended with the possibility to edit the columns text...
5
by: Rosa | last post by:
Hi, I'm trying to clear the TIF on Windows XP programmatically with the below code. This code works fine on any folder but the TIF. For some reason the atEnd() statements always defaults to true...
2
by: Coffee guy | last post by:
I need to locate an item in ListView, quickly. I have a listview with items, for each I added a unique "Tag" property. Is there a simple way to rapidly search through these items to find based on...
1
by: jez123456 | last post by:
Hi, I have a windows form with a listbox control. My code all works correctly when deleting an item from the listbox except the last item. I get the following message when trying to delete the...
0
by: luckybird | last post by:
I succeeded in obtaining a CListCtrl item info using HitTest() when the List Ctrl is owned by my current thread. But when I tried HitTest an item of a List Ctrl owned by other threads such as...
1
by: akameswaran | last post by:
I have a list box, I'd like to generate a right click menu for items in the list box. The problem is unless I left click the item first, I can't figure out which item in the list I clicked over. ...
8
by: Tim Chase | last post by:
When you have a set, known to be of length one, is there a "best" ("most pythonic") way to retrieve that one item? # given that I've got Python2.3. on hand, # hack the following two lines to get...
3
by: ianaré | last post by:
hey, Having some problems getting wxpython apps to look right on SuSE 10.0 and KDE 3.4. There are no RPMs that i could find so I built my own from source. First time using 'default' settings -...
0
by: carlosperezs | last post by:
I have problems with this method. I have programmed this wx.Listctrl: self.ListCtrlMarks = wx.ListCtrl(self.panel, -1, style = wx.LC_REPORT) ...
0
by: Laszlo Nagy | last post by:
This is a ListCtrl descendant: class MegaListCtrl(wx.ListCtrl): <more code here....> def InsertImageStringItem(self, index, label, imageIndex): imageIndex =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.