Hello there,
I'm trying to anchor a SecureActionButton to a FontString, but it doesn't seem to work - the SecureActionButton just doesn't show up at all. Here's an example:
Code:
local frame = CreateFrame("Frame", nil, UIParent)
frame:SetBackdrop({ bgFile = "Interface/BUTTONS/WHITE8X8" })
frame:SetBackdropColor(1, 0, 0, 0.5)
frame:SetPoint("LEFT")
frame:SetWidth(100)
frame:SetHeight(100)
local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlight")
label:SetText("Test")
label:SetPoint("TOPLEFT")
local button = CreateFrame("Button", nil, frame, "SecureActionButtonTemplate")
button:SetBackdrop({ bgFile = "Interface/BUTTONS/WHITE8X8" })
button:SetHeight(20)
button:SetWidth(80)
button:SetPoint("TOPLEFT", label, "BOTTOMLEFT")
button:SetScript("OnClick", function() print("Button was clicked!") end)
What I expect: there should be a white square (the button) below the text "Test". Anchoring to a Frame works, like replacing the line
Code:
button:SetPoint("TOPLEFT", label, "BOTTOMLEFT")
with
Code:
button:SetPoint("TOPLEFT", frame, "BOTTOMLEFT")
Will show the white square (the button) below the red frame. This only seems to happen when I inherit from SecureActionButtonTemplate. Removing that when creating the button lets me anchor the button the the FontString.
Is that some limitation of the SecureActionButton? If so, what's the best way around? Just to create another frame where the FontString is, and anchor to that frame?