Also, the TEXT() function is legacy code from the very earliest iterations of the Blizzard UI; you should never use it in an addon. It literally just
returns the string you pass to it:
Code:
function TEXT(text)
return text;
end
Just write the string you want to use.
As to the actual question:
SetText and SetFormattedText are methods that exist on
font string objects -- not
string values. "Font string" is a type of widget in the WoW UI API, like "texture", "frame", or "button". "String" is a type of value in the Lua programming language, like "number", "boolean", or "table".
If you want to display text, you either need to create a font string (which in turn needs to be attached to a frame):
lua Code:
local frame = CreateFrame("Frame", "LazareQuestFrame", UIParent)
frame:SetSize(100, 100)
frame:SetPoint("CENTER")
local fontstring = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
fontstring:SetPoint("CENTER")
... or find the name of, or a reference to, a font string that already exists in the UI. Then you can tell it what text to display:
Lua Code:
fontstring:SetText("Track")
SetFormattedText is a "shortcut" to calling string.format and SetText; these do the same thing:
Lua Code:
fontstring:SetText(string.format("You have %d cats.", 42))
fontstring:SetFormattedText("You have %d cats.", 42)
The difference is that SetFormattedText shifts the string.format operation over into C code, where it's (presumably) faster than running it in Lua. Unless you're doing it a million times in a row, though, you'll never notice the difference, so the main reason to use SetFormattedText is that it makes your code less verbose and more readable.
Edit:
After re-reading your post I noticed that you mentioned you think the TRACK_QUEST_ABBREV variable is referring a button. That is not correct -- the
Blizzard UI code defines TRACK_QUEST_ABBREV as containing the string "Track". If you overwrote that value with a pointer to a button object, that's even worse -- not only does your code still not work, but you're also breaking any part of the default UI and other addons that expect TRACK_QUEST_ABBREV to be a string.
Please post the rest of your code.