Wowpedia
Advertisement

Fires when clicking a hyperlink.

(self, link, text, button)

Arguments

self 
Frame - The widget containing a FontInstance.
link 
string - The link payload (e.g. "item:6948:0:0:0:...").
text 
string - The link label (e.g. "[Hearthstone]").
button 
string - "LeftButton", "RightButton", "MiddleButton", "Button4", "Button5", ..., "ButtonN"

Details

Examples

Using ChatFrame_OnHyperlinkShow() to mimick the default chat frames.[1]

local frame = CreateFrame("ScrollingMessageFrame")
frame:SetScript("OnHyperlinkClick", ChatFrame_OnHyperlinkShow)


Responding to a hyperlink contained in a child FontString.

local frame = CreateFrame("Frame")
frame:SetPoint("CENTER")
frame:SetSize(200, 50)
frame:SetHyperlinksEnabled(true)
frame:SetScript("OnHyperlinkClick", function(self, link, text, button)
	SetItemRef(link, text, button, self)
end)

local fontString = frame:CreateFontString(nil, "ARTWORK", "GameFontNormal")
fontString:SetAllPoints()
fontString:SetText(select(2,GetItemInfo(6948)))

Patch changes

WoW Icon update.png Patch 1.6.0 / API (2005-07-12): Added text argument.[2]

References

Advertisement