wxListCtrl Deprications

self.list.SetItemBackgroundColour(index, “#eeeeee”)

Is this what you a looking for ?

More like this:

rowIdx = 0
         for rowIdx in range(self.list_ctrl.GetItemCount()):
#                 liStatus = self.list_strl.GetItem(rowIdx, 2)
                  sStatus = str(liStatus.GetText())
                  print(sStatus)
 
                  if sStatus == "Running":
                      self.list_ctrl.SetItemBackgroundColour(rowIdx, "green")

https://wxpython.org/Phoenix/docs/html/wx.ColourDatabase.html

Yes, that is the expected way to add items to a report-mode listctrl. In order to not have to worry about the correct indexes yourself, the common pattern is to do it something like this:

  index = self.list_ctrl.InsertItem(self.list_ctrl.GetItemCount(), row[0])
  self.list_ctrl.SetItem(index,1, row[2])
  self.list_ctrl.SetItem(index,2, row[2])
  self.list_ctrl.SetItem(index,3, row[3])

This way the index used for the SetItem calls will be sure to match the row where the item was created. Most of the time it will be the last item in the list, but if you switch to using auto-sorting then it could be different.

You may want to consider switching to a virtual mode listctrl. In addition to the OnGetItemText method like I mentioned in the other current thread about listctrl’s, there is the OnGetItemAttr method that the listctrl will call when it needs to get the visual attributes of an item it needs to draw, as it needs to draw them. So instead needing to load everything into the list and changing attributes for possibly not-visible items, you just keep your data in some other collection and wait for the listctrl to ask you what the text and attributes should be draw on the widget. When something changes in your data or other relevant program state you can update your data collection and then Refresh the listctrl.