I'm fairly new to Python, and using wxPython for the first time, so please excuse any ignorance in this question.
I'm trying to use the wxEditableListBox, but I'm running into a couple of problems getting events from it. The code I'm using looks like:
self.elb = wxEditableListBox(self, -1, '', size=(150, 100), style=wxEL_ALLOW_NEW | wxEL_ALLOW_DELETE)
elbId = self.elb.GetListCtrl().GetId()
EVT_LIST_ITEM_SELECTED(self, elbId, self.onItemSelected)
newId = self.demoControl.GetNewButton().GetId()
EVT_BUTTON(self, newId, self.onNew)
def onItemSelected(self, event):
print 'item selected'
def onNew(self, event):
print 'new'
I add 2 items to the list elsewhere. I would expect to see 'item selected' when I single click on an item, and 'new' when I click on the new item button. Neither works. However, when I do:
EVT_LIST_ITEM_ACTIVATED(self, elbId, self.onItemSelected)
I do see 'item selected' printed to the console. What am I doing wrong?
I'm using wxPython 2.4 for Python 2.2
Thanks in advance,
Adam Endicott