View Single Post
11-29-14, 04:58 AM   #3
thebdc
A Murloc Raider
Join Date: Mar 2011
Posts: 5
That explanation makes sense I guess. I tried your suggestion and it works fine. Here's the code, if anybody cares:

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 button = CreateFrame("Button", nil, frame, "SecureActionButtonTemplate")
button:SetBackdrop({ bgFile = "Interface/BUTTONS/WHITE8X8" })
button:SetHeight(20)
button:SetWidth(80)
button:SetScript("OnClick", function() print("Button was clicked!") end)

local label = button:CreateFontString(nil, "BACKGROUND", "GameFontHighlight")
label:SetText("Test")

button:SetPoint("TOPLEFT", frame, "TOPLEFT", 0, -label:GetStringHeight())
label:SetPoint("BOTTOMLEFT", button, "TOPLEFT")
  Reply With Quote