FAQ
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://docs.wxwidgets.org/stable/wx_wxlistitem.html#wxlistitem
but I can not figure out how and when I am supposed to use the 'm_mask'
property.

TIA

David.

Search Discussions

  • Tim Roberts at Dec 27, 2009 at 1:17 am

    David wrote:
    I have la ListCtrl in LC_REPORT mode and i need to change the color of a
    single cell.
    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, timr at probo.com
    Providenza & Boekelheide, Inc.
  • David at Dec 27, 2009 at 7:53 pm

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

    I have la ListCtrl in LC_REPORT mode and i need to change the color of a
    single cell.
    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.
    Thank you for explanation. I am looking at the UltimateListCtrl class by
    Andrea Gavana that allow finer control over the single cell attributes.

    David.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedDec 25, '09 at 6:32a
activeDec 27, '09 at 7:53p
posts3
users2
websitepython.org

2 users in discussion

David: 2 posts Tim Roberts: 1 post

People

Translate

site design / logo © 2022 Grokbase