I've a wx.ListCtrl and a list of object, say a list of "Person" objects. I would like to add the single object to a row of a wx.ListCtrl and show only a set of attributes.
In this way when i select one or more rows i would like to retrieve the object inside of the rows not the strings.
It seems simple but i would like to preserve sorting of the wx.ListCtrl; is there a way to do it ? Probably i have to subclass the wx.ListCtrl, is there an example ?
Here a sample code of how it could work:
listCtrl.bind('name')
listCtrl.bind('surname')
listCtrl.appendRows(listOfPersonObjects)
In this way i show only two columns with name and surname.
and with:
listCtrl.GetSelectedObjects()
i retrieve the person object that the user has selected.
On Nov 1, 2008, at 1:59 PM, gioacchinomauri@libero.it wrote:
Hi there,
I've a wx.ListCtrl and a list of object, say a list of "Person" objects. I would like to add the single object to a row of a wx.ListCtrl and show only a set of attributes.
In this way when i select one or more rows i would like to retrieve the object inside of the rows not the strings.
It seems simple but i would like to preserve sorting of the wx.ListCtrl; is there a way to do it ? Probably i have to subclass the wx.ListCtrl, is there an example ?
Here a sample code of how it could work:
listCtrl.bind('name')
listCtrl.bind('surname')
listCtrl.appendRows(listOfPersonObjects)
In this way i show only two columns with name and surname.
and with:
listCtrl.GetSelectedObjects()
i retrieve the person object that the user has selected.
On Sat, Nov 1, 2008 at 2:59 PM, gioacchinomauri@libero.it <gioacchinomauri@libero.it> wrote:
Hi there,
I've a wx.ListCtrl and a list of object, say a list of "Person" objects. I would like to add the single object to a row of a wx.ListCtrl and show only a set of attributes.