WoW:API CreateFrame: Difference between revisions

m
sp
No edit summary
m (sp)
Line 36: Line 36:
* The fourth argument, inheritFrame, was added in 1.11
* The fourth argument, inheritFrame, was added in 1.11
* In creating frames with CreateFrame(), you cannot use the OnLoad script handler (e.g. Frame:SetScript("OnLoad", ''function'')) since CreateFrame() loads the frame before Frame:SetScript() is called. If you want to use the OnLoad script handler, define the frame in an XML file that is called before the LUA file or call the OnLoad function manually at the end of the LUA file.
* In creating frames with CreateFrame(), you cannot use the OnLoad script handler (e.g. Frame:SetScript("OnLoad", ''function'')) since CreateFrame() loads the frame before Frame:SetScript() is called. If you want to use the OnLoad script handler, define the frame in an XML file that is called before the LUA file or call the OnLoad function manually at the end of the LUA file.
*: ''Considering that the developer is creating the frames with lua, there is not much point in a handler that runs an lua function when the frame is loaded... the developer can just run their code in the lua file that's creating the frame immediatly after they create the frame!''
*: ''Considering that the developer is creating the frames with lua, there is not much point in a handler that runs an lua function when the frame is loaded... the developer can just run their code in the lua file that's creating the frame immediately after they create the frame!''
Anonymous user