I've found some strange behavior within the Set/GetFrameRef() thing for secure frames.
Consider the following code:
Lua Code:
local header = CreateFrame("Frame", "testheader", UIParent, "SecureHandlerStateTemplate")
header:SetFrameRef("ActionButton1", _G["ActionButton1"])
local button = CreateFrame("CheckButton", "testbutton1", header, "SecureActionButtonTemplate, ActionButtonTemplate")
button:SetPoint("CENTER", UIParent, "CENTER")
header:WrapScript(button, "OnClick", [[
print("ActionButton1.IsForbidden =", self:GetParent():GetFrameRef("ActionButton1").IsForbidden)
]])
print("ActionButton1.IsForbidden =", _G["ActionButton1"].IsForbidden, _G["ActionButton1"]:IsForbidden())
It prints:
ActionButton1.IsForbidden = function: <.....> false
|
Now click the test button.
It prints:
ActionButton1.IsForbidden = nil
|
Ehm?
Try again:
Lua Code:
print("ActionButton1.IsForbidden =", _G["ActionButton1"].IsForbidden, _G["ActionButton1"]:IsForbidden())
Result:
ActionButton1.IsForbidden = function: <.....> false
|
WTF??
So, is it me, or is GetFrameRef() returning something that is not equal to the original object that was passed to SetFrameRef()?
Could someone please verify if this is a bug or if I'm just stupid?