FramePoolCollectionMixin:CreatePool()

From Warcraft Wiki
Jump to navigation Jump to search
These functions are implemented in :CreatePool FrameXML/Pools.lua.

Returns a frame pool within a collection of frame pools.

pool = collection:CreatePool(frameType, parent, template [, resetterFunc, forbidden])
pool = collection:GetOrCreatePool(frameType, parent, template [, resetterFunc, forbidden])
collection:CreatePoolIfNeeded(frameType, parent, template [, resetterFunc, forbidden])

Arguments

frameType
string - See CreateFrame().
parent
string|nil - Required, even if nil, because the third argument is required.
template
string - Identifies each pool within the collection.
resetterFunc
function?Optional. Could be nil. - See CreateFramePool().
forbidden
boolean?Optional. Could be nil. - See CreateFramePool().

Returns

pool
table - FramePoolMixin

Details

  • Every pool in a collection is identified by its XML template, so unlike CreateFrame or CreateFramePool this argument is required.
  • GetOrCreatePool() avoids overwriting an existing pool, which CreatePool() would do.
  • CreatePoolIfNeeded() also creates the pool if it does not exist, but without any return value.

Example

local collection = CreateFramePoolCollection()
collection:CreatePool("Frame", nil, "BackdropTemplate")
local frame = collection:Acquire("BackdropTemplate")

Patch changes

References

 
  1. ^ 2019-06-25, Pools.lua, version 9.1.0.38312, near line 220, archived at Townlong-Yak
  2. ^ 2019-06-25, Pools.lua, version 8.2.0.30920, near line 216, archived at Townlong-Yak
  3. ^ 2019-03-12, Pools.lua, version 8.1.5.29701, near line 232, archived at Townlong-Yak
  4. ^ 2017-08-28, Pools.lua, version 7.3.0.24920, near line 210, archived at Townlong-Yak