Problem with wxlistCtrl in report mode

Håkan Johansson wrote:

Hello!
Im having some problems with wxListCtrl in linux. The code I use in windows XP doesn't work under Suse linux 8.2.

When i try to use SetStringItem on my listctrl I get this error:
wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed in /home/robind/tmp/_rpm_top/BUILD/wxPythonSrc- 2.4.1.2/src/generic/listctrl.cpp(1546): invalid column index in SetItem

self.listCtrl1 = wxListCtrl(id=wxID_WXFRAME1LISTCTRL1, name='listCtrl1', parent=self, pos=wxPoint(0, 0), size=wxSize(451, 249),
style=wxLC_REPORT | wxLC_ICON, validator=wxDefaultValidator)

I don't think you can combine wxLC_REPORT and wxLC_ICON - they are two separate modes of the list control. If you remove the SetStringItem command so the program doesn't crash, does it actually display in report mode or in large-icon mode?

···

self.ListCtrl1.InsertColumn(col=0, format=wxLIST_FORMAT_LEFT, heading='Columns0', width=-1)
self.ListCtrl1.InsertColumn(col=1, format=wxLIST_FORMAT_LEFT, heading='Columns1', width=-1)

self.listCtrl1.InsertStringItem(0,'test')
self.listCtrl1.SetStringItem(0,1,'test2')

Any help would be appreciated.
Håkan Johansson

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

It does show a wxListCtrl in report mode and it works well in Windows XP, but
I tried removing wxLC_ICON and......TADA it works! I can't believe it was that
simple, what really confused me was that it worked in XP!?
Thanks alot!

Håkan Johansson

···

On Thu, 21 Aug 2003 08:41:38 -0400, David C. Fox <davidcfox@post.harvard.edu> wrote:

Håkan Johansson wrote:

Hello!
Im having some problems with wxListCtrl in linux. The code I use in windows XP doesn't work under Suse linux 8.2.

When i try to use SetStringItem on my listctrl I get this error:
wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed in /home/robind/tmp/_rpm_top/BUILD/wxPythonSrc- 2.4.1.2/src/generic/listctrl.cpp(1546): invalid column index in SetItem

self.listCtrl1 = wxListCtrl(id=wxID_WXFRAME1LISTCTRL1, name='listCtrl1', parent=self, pos=wxPoint(0, 0), size=wxSize(451, 249),
style=wxLC_REPORT | wxLC_ICON, validator=wxDefaultValidator)

I don't think you can combine wxLC_REPORT and wxLC_ICON - they are two separate modes of the list control. If you remove the SetStringItem command so the program doesn't crash, does it actually display in report mode or in large-icon mode?