The layer is set to BACKGROUND. Is the texture rendered behind the frame or frame background texture? Try to set the texture draw layer to "TOOLTIP" instead of "BACKGROUND".
The following code does show the texture:
Lua Code:
local strvars = {}
strvars["enchant_title"] = UIParent:CreateFontString(nil, "OVERLAY", "GameFontNormal")
strvars["enchant_title"]:SetPoint("CENTER", UIParent, "CENTER", 0, -20)
strvars["enchant_title"]:SetText("Missing Enchants:")
strvars["enchant_title"]:SetJustifyH("LEFT")
strvars["enchant_title"]:CanWordWrap(true)
strvars["enchant_title"]:SetWidth(CharacterModelFrame:GetWidth() - 20)
key = 1
-- Item icon.
strvars["eBTN" .. key] = CreateFrame("Button", nil, infoFrame)
strvars["eBTN" .. key]:SetWidth(16)
strvars["eBTN" .. key]:SetHeight(16)
if key == 1 then
strvars["eBTN" .. key]:SetPoint("TOPLEFT", strvars["enchant_title"], "BOTTOMLEFT", 0, -5)
else
strvars["eBTN" .. key]:SetPoint("TOPLEFT", strvars["eBTN" .. (key - 1)], "BOTTOMLEFT", 0, -10)
end
strvars["eBTN" .. key]:SetFrameStrata("HIGH")
strvars["eICO" .. key] = strvars["eBTN" .. key]:CreateTexture(nil, "BACKGROUND")
strvars["eICO" .. key]:SetTexture("Interface\\Tooltips\\UI-Tooltip-Background")
strvars["eICO" .. key]:SetAllPoints(strvars["eBTN" .. key])
So either your texture is behind the frame background, or the variable 'texture' does not contain a texture path.