Originally Posted by Ketho
The above code actually works. Did you instead mean this, Phanx?
Code:
local frame = CreateFrame("Button", "ABANDON_QUEST", UIParent, "UIPanelButtonTemplate")
ABANDON_QUEST:SetPoint("CENTER")
ABANDON_QUEST:SetSize(100, 100)
ABANDON_QUEST:SetText("Abandon Quest!")
|
No, but that would also fail, for the same reason. Re-read the OP's code. Once a global is set, it cannot be overwritten by creating a new UI object with the same name, so even through you pass "ABANDON_QUEST" as the global name in the CreateFrame call, the OP's code would see that there is already a global named "ABANDON_QUEST", and simply return that (a string) instead of actually creating a new frame. Either way, the global "ABANDON_QUEST" still points to the original string, and the
frame variable is given that string as its value.