ListCtrl - Adding things other than strings to the control

Hello

I have a ListCtrl with 3 columns & I want to add a row. The row will
have a string in the first column, an int in the 2nd & a wx.ComboBox()
in the 3rd.

My problem is I cant find an example or functions that will allow me
to add this row? Can I add these kinds of objects to a ListCtrl or
should I be using a different Control? I am aware I can use
the .InsertString() but is there any other functions that can allow me
to insert an int & a ComboBox?

This code doesn't work:

row = wx.ListItem( "Hello", 2, wx.ComboBox( self.list_ctrl, wx.ID_ANY,
choices = ('a', 'b', 'c') ) )

self.list_ctrl.InsertItem( row )

Hi Sascha,

···

On 13/09/2010 09:27, Sascha wrote:

Hello

I have a ListCtrl with 3 columns& I want to add a row. The row will
have a string in the first column, an int in the 2nd& a wx.ComboBox()
in the 3rd.

My problem is I cant find an example or functions that will allow me
to add this row? Can I add these kinds of objects to a ListCtrl or
should I be using a different Control? I am aware I can use
the .InsertString() but is there any other functions that can allow me
to insert an int& a ComboBox?

This code doesn't work:

row = wx.ListItem( "Hello", 2, wx.ComboBox( self.list_ctrl, wx.ID_ANY,
choices = ('a', 'b', 'c') ) )

self.list_ctrl.InsertItem( row )

Not sure you can do this with a wx.ListCtrl, have a look at wx.lib.agw.UltimateListCtrl and at ObjectListView - ObjectListView — ObjectListView v1.2 documentation

For the first you should check out the wxPython demo.

Werner

I had that problem too, Werner is right, UltimateListCtrl is the way
to go, if you want to add a combobox or any other type of widget to a
ListCtrl, UltimateListCtrls act just like a ListCtrl, and I believe
all the methods for ListCtrls exist for UltimateListCtrls as well.
Andrea is the dev on agw and UltimateListCtrl, so if you have more
questions, ask Andrea.