Question

I am using a wx.listctrl inside a wxpython GUI. I have a list that updates when I click a button. Currently when I select an item and click the button, I do the following:

item = self.my_list.GetItem(row_in_list)
self.my_list.SetItemTextColour(row_in_list,'red')

In addition to turning the font red, I would like to "cross it out" or "strikethrough". I have found wx.FFont(8, wx.FONTFAMILY_SWISS, face='Tahoma', flags = wx.FONTFLAG_STRIKETHROUGH) but this does not seem to work. Any one have ideas? Thanks!

Was it helpful?

Solution

As far as I can tell, strike-throughs are not supported in the ListCtrl widget itself. You would have to create some kind of custom widget or switch to using the aforementioned UltimateListCtrl, which is a very flexible pure Python widget. You can see it in action in the wxPython demo package or read about in the following links:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top