deselect an iterm in ListBox wxPython

Bailu lingyun.yang at gmail.com
Sat Aug 11 03:53:30 EDT 2007


Hi,

   I am a newbie in wxPython and doing a program with ListBox,
I want to select and deselect items in this box,
I have use

self.devlist = wx.ListBox(self, style=wx.LB_MULTIPLE)
self.Bind(wx.EVT_LISTBOX, self.select_dev, self.devlist)

to create this box, but don't know how to implement self.select_dev
to find out which one is clicked

deselect it, if it was selected  ( this is not working at default)
select it, if it was not (toggle)

The default behavior is, the selection is increasing, I can't deselect
any of them.

Thanks.

Lingyun




More information about the Python-list mailing list