FR: ListBox::repaintRow()


#1

Jules,

any chance you could throw a repaintRow(const int index) method into ListBox.

There are two situations I can think of where that might be handy:

  1. in my app I’m using a custom selected-rows highlighting approach. A rectangle is drawn around selected rows, with a very light alpha fill. This means that if the selection state of one row changes, the two rows either side need to be repainted as well, to correctly update the border.

  2. in some case you may need an element in the list to show a lightweight visual cue to some event. Specifically, if some state related to an item changes, that does not change the item text, but you want to change the colour of the item, say. Currently you’d need to make a custom component to have the items react to such events.


#2

Yes, sounds like a sensible request. It’d just be equivalent to “repaint (getRowPosition (rowNumber));”


#3

that’d be an approach, wouldn’t it. :idea:

for readability’s sake, a specific repaint method would be nice though.


#4

Consider it done.


#5