View Single Post
04-19-12, 01:00 PM   #9
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Ketho View Post
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.
  Reply With Quote