I've been seeing a lot of Blizzard code using CreateFramePool() and I'm wondering if it's worth using this myself as opposed to creating my own stack-like data structure. However, maybe it does something more than this but I can't find any documentation on it.
This is the content found inside a returned frame pool object:
ReleaseAll
achieveObjects
numActiveObjects
inactiveObjects
GetNumActive
resettingFunc
OnLoad
creationFunc
EnumerateActive
Release
Acquire
GetNextActive
EnumerateIntactive
My question is this: Is there any documentation on how to use this?
I'm assuming that you can disable/enable frames from the pool using:
Lua Code:
local pool = CreateFramePool()
local frame = pool:Acquire() -- uses an inactive frame or creates one with "creationFunc" function
pool:Release(frame) -- not really sure if this is the correct way to disable the frame
-- something is always true. Maybe it represents if the frame is active, but since I am iterating over only active frames this seems pointless
for frame, something in pool:EnumerateActive() do
-- run code to update your frame (could be a buff icon for example)
end
Not sure what OnLoad does. Does it run when a frame becomes active?