[wxPy] Why I can not change a ListItem property?

[wxPy] Why I can not change a ListItem property?

Post by Davi » Sat, 26 Dec 2009 15:32:36


I have la ListCtrl in LC_REPORT mode and i need to change the color of a
single cell.
I tried to set the ListItem properties like this

item = wx.ListItem()
item.SetId(currId)
item.SetColumn(currCol)
item.SetText(text)
item.SetTextColour(wx.RED)
mylistctrl.SetItem(item)

but the .SetTextColor doesn't seem to do anything.
How can I change properties of a single cell?
Where can i find more detailed documentation? I read the documentation at
http://www.yqcomputer.com/ #wxlistitem
but I can not figure out how and when I am supposed to use the 'm_mask'
property.

TIA

David.
 
 
 

[wxPy] Why I can not change a ListItem property?

Post by Tim Robert » Mon, 28 Dec 2009 10:17:20


That can't be done. In LC_REPORT mode, the whole row has to be the same
color. You can't change individual cells within a row.

You need an owner-draw control. See the ListCtrl_virtual.py example, for
instance.
--
Tim Roberts, XXXX@XXXXX.COM
Providenza & Boekelheide, Inc.

 
 
 

[wxPy] Why I can not change a ListItem property?

Post by Davi » Tue, 29 Dec 2009 04:53:41

Il Sat, 26 Dec 2009 17:17:20 -0800, Tim Roberts ha scritto:


Thank you for explanation. I am looking at the UltimateListCtrl class by
Andrea Gavana that allow finer control over the single cell attributes.

David.