This is my first addon. I have a list which is basically Meorawr's HybridScrollFrame demo, just with a different dataset.
https://gist.github.com/Meorawr/7d67...7a875db3fd1d7a
If an item's itemName exists within a given itemArray, I want to colour the row background, which I've done like this:
Code:
button.Text:SetText(item.text or "");
local tex = button:CreateTexture(nil, "BACKGROUND")
tex:SetAllPoints()
tex:SetTexture("Interface\\Tooltips\\UI-Tooltip-Background")
tex:SetGradientAlpha("HORIZONTAL", unpack({0.15,0.6,0.15,1, 0.15,0.6,0.15,0}))
button.Texture = tex
button.Texture:Hide()
if ItemExists(itemArray, item.itemName) then
button.Texture:Show()
end
This puts the background in as expected for the right items on load, but when I scroll down, the coloured background 'sticks' to the top of the list, and ends up colouring the background of the items I scrolled past. I also noticed that some rows appear to get the background applied more than once(?) as the opacity/gradient varies between them. I've attached images of the initial view (1), and what happens when you scroll down (2) and back up (3).
I'd be very grateful if someone could point me in the right direction.