As the title, I don't understand why I can't change selected item background color. Here my code...
self.listaFatture = wx.ListCtrl(self, size=(frame.GetSize().Width - 30, frame.GetSize().Height - 250), style=wx.LC_REPORT)
.....
self.listaFatture.Bind(wx.EVT_LIST_ITEM_SELECTED, self.SelezionaFatturaColore)
.....
def SelezionaFatturaColore(self,event):
print('Selezionato')
index= event.GetIndex()
self.listaFatture.SetItemBackgroundColour(index, 'gray')
self.listaFatture.SetItemTextColour(index, 'black')
The event is fired but the colors doesn't change
Thanks in advance to all that try to help me
I found a workaround, I don't know if is a bug or not.
I set a variable with -1 and after, when I select a row I remember the index, I deselect it ad after I set the color...
More simple to read the code...