Thread: tooltip example
View Single Post
05/27/14, 03:00 PM   #5
Kentarii
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
Another one, just to give you more to choose from:
Lua Code:
  1. --- Add a tooltip to a control.
  2. -- @param ctrl the control element.
  3. -- @param text the text to show on mouse over.
  4. -- @return void
  5. local function SetToolTip(ctrl, text)
  6.     ctrl:SetHandler("OnMouseEnter", function(self)
  7.         ZO_Tooltips_ShowTextTooltip(self, TOP, text)
  8.     end)
  9.     ctrl:SetHandler("OnMouseExit", function(self)
  10.         ZO_Tooltips_HideTextTooltip()
  11.     end)
  12. end
  Reply With Quote