Originally Posted by Fizzlemizz
Rather than tremove and tinsert (which don't return anything) add the frame name to your table by name
Code:
local frame = TDButton_FramePool['TDButton_Overlay_' .. id]
if not frame then
frame = CreateFrame('Frame', 'TDButton_Overlay_' .. id, parent);
TDButton_FramePool['TDButton_Overlay_' .. id] = frame
-- You waon't need to set the name attribute
end
|
Except that tremove returns the value that's been removed. In your snippet above, you're only adding the frame to the pool if it's newly-created, but the destroy function removes them all so this will be an issue.