Originally Posted by Dejablue
Any way to recycle the frames? Hmmm.
|
That's what we're doing.
You may also be having trouble with positioning. If you /fstack over the buttons you'll probably find you have a bunch of "BMUDButton"..xxx buttons positioned over the top of each other.
Edit: Thanks syncrow. You will need to keep a tally rather than just using the last itemCount value for the text.
The recycle code
Lua Code:
local BMUDButton
if not _G["BMUDButton"..name] then -- Button does not exist so create it
BMUDButton = CreateFrame("Button", "BMUDButton"..name, UIParent, "SecureActionButtonTemplate");
-- BMUDButton points to a shiney new button
else
BMUDButton = _G["BMUDButton"..name]
-- BMUDButton points to the previously created button
end