Issue with TableListBoxModel


#1

Hi Jules,

(using the tip)
It looks like there is some issue with TableListBoxModel when not reusing/updating the same widget.
When refreshComponentForCell delete the existingComponentToUpdate and always call createComponentForCell
and returns this new widget, if the caching mechanism is used(scrollbar moved for example) then we have some duplicated items.
Bottom item is shown at the top and stuff like that.

This works fine if there is no scrollbar. (probably no caching mechanism in that case)

Hope this make sense.

Thanks,


#2

Ok… How about just adding a deleteAllChildren() call in juce_TableListBox.cpp when the row changes?

void update (const int newRow, const bool isNowSelected) { if (newRow != row || isNowSelected != isSelected) { row = newRow; isSelected = isNowSelected; repaint(); deleteAllChildren(); }


#3

It did the trick.
So hopefully you see what’s going on.

Thanks,