The API is no longer being updated here until further notice. |
Fires when clicking a hyperlink.
(self, link, text, button, region, left, bottom, width, height)
Arguments[]
- self
- Frame - The widget registered for this script handler.
- 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"
- region
- Region - The Region the hyperlink belongs to.
- left
- number - The x position of the hyperlink in pixels, relative to the region top left corner.
- bottom
- number - The y position of the hyperlink in pixels, relative to the region top left corner.
- width
- number - Hyperlink width in pixels.
- height
- number - Hyperlink height in pixels.
Details[]
- Requires Frame:SetHyperlinksEnabled(), or a child frame defined in XML with <Frame propagateHyperlinksToParent="true">.
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[]
Patch 1.6.0 (2005-07-12): Added text argument.[2]
References[]
- ^ Vrul 2018-04-01. itemLinks in an addon frame?. WoWInterface.
- ^ Iriel 2005-12-07. Actual UI Code Changes in 1.6. Archived from the original