wxListCtrl:InsertColumnInfo() method bug?

Hi,

I tried to change the background colour of wxListCtrl column header the next
way:

···

#####################
from wxPython.wx import *

app = wxPySimpleApp()
frm = wxFrame(None, wxNewId(), "")
pnl = wxPanel(frm, wxNewId())

list = wxListCtrl(pnl, wxNewId(), size = wxSize(200, 100), style=wxLC_REPORT

wxSUNKEN_BORDER)

item = wxListItem()
item.SetText('1')
item.SetWidth(100)
item.SetBackgroundColour(wxRED)

list.InsertColumnInfo(0, item)
list.InsertColumn(1, "2", width = 100)

frm.Show(True)
app.MainLoop()
#####################

It seems like the code should change the background of the first column to
red, but instead it skips from adding the column.

Ilia Kats wrote:

It seems like the code should change the background of the first column to
red, but instead it skips from adding the column.

You can only change the colors (and other attributes) of the list items, which in report mode is an entire row.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!