How do I change the font color of a selected item in the
CheckListCtrl ?
For a selected item I would like the change the color of text in the accompanying text of the selected item ?
class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin, ListCtrlAutoWidthMixin):
def __init__(self, parent):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT | wx.SUNKEN_BORDER)
CheckListCtrlMixin.__init__(self)
ListCtrlAutoWidthMixin.__init__(self)
Paul6
October 4, 2011, 1:17pm
2
michelle yaobao <michelle.yaobao <at> gmail.com> writes:
How do I change the font color of a selected item in the
CheckListCtrl ?
For a selected item I would like the change the color of text in the
accompanying text of the selected item ?
class CheckListCtrl\(wx\.ListCtrl, CheckListCtrlMixin,
ListCtrlAutoWidthMixin):
def \_\_init\_\_\(self, parent\):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT | wx.SUNKEN_BORDER)
CheckListCtrlMixin.__init__(self)
ListCtrlAutoWidthMixin.__init__(self)
Hey, try this
class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin,
ListCtrlAutoWidthMixin):
def __init__(self, parent):
wx.ListCtrl.__init__(self, parent, -1,
style=wx.LC_REPORT|x.SUNKEN_BORDER)
CheckListCtrlMixin.__init__(self)
ListCtrlAutoWidthMixin.__init__(self)
self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelect)
def OnSelect(self,event):
index= event.GetIndex()
self.SetItemTextColour(index,wx.Colour(255,0,0))