Another one, just to give you more to choose from:
Lua Code:
--- Add a tooltip to a control.
-- @param ctrl the control element.
-- @param text the text to show on mouse over.
-- @return void
local function SetToolTip(ctrl, text)
ctrl:SetHandler("OnMouseEnter", function(self)
ZO_Tooltips_ShowTextTooltip(self, TOP, text)
end)
ctrl:SetHandler("OnMouseExit", function(self)
ZO_Tooltips_HideTextTooltip()
end)
end