[wxPython-users] EditableListBox buttons
L. Fanchi
lorenzo.fanchi at gmail.com
Fri Mar 7 10:59:27 PST 2008
I'm trying to get the sort and delete buttons to work, but I'm also
having problems with those.
Here's what I did:
imageList = gizmos.EditableListBox(panel, -1, "Images", pos =
(300,80), size = (250, 330), style = wx.gizmos.EL_ALLOW_DELETE)
imageList.SetStrings([])
imageList_w = imageList.GetListCtrl()
imageList_delbutton = imageList.GetDelButton()
imageList_delbutton.Enable(True)
self.Bind(wx.EVT_BUTTON, self.OnDeleteItem, imageList_delbutton)
wx.EVT_LIST_ITEM_SELECTED(imageList, imageList_w.GetId(),
self.OnItemSelected)
The event for the selection of the item triggers the
self.OnItemSelected, but the delete button, for some reason, doesn't
trigger the self.OnDeleteItem at this point..
Any tips?
Thanks in advance!
Robin Dunn wrote:
> L. Fanchi wrote:
>> Thank you, that worked perfectly!
>>
>> I can't seem to find a page which explains how to catch interactions
>> with the EditableListBox.
>> E.g. when the user presses the delete button, I'd like it to delete
>> the entry in the list I made it load.
>> Also the sorting isn't applied to the loaded list.. ListCtrl
>> commands, like EVT_LIST_ITEM_SELECTED, don't seem to work..
>>
>> Is there a page where I can find what commands to use with
>> EditableListBox?
>
> You can get access to the internal listctrl using the GetListCtrl
> method. Using that you should be able to do anything you can do with
> any other listctrl.
>
More information about the wxpython-users
mailing list