View Single Post
08-19-17, 05:59 AM   #7
Ekaterina
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 65
Forgive my ignorance but does the tooltip itself have an onleave event? I an able to interact with the tooltip but when the mouse leaves it it stays there until i mouse back onto the LDB point and leave it.
Taking a look at the LibQTip-1.0 api here at WowAce, the tooltip doesn't appear to have an automatic OnLeave function. The way I understand it is that the tooltip is a (collection of) frame/s, so you could register a function to the tootip's OnLeave event, but the easier way to close it is provided by the API. :SetAutoHideDelay(delay, alternateFrame, releaseHandler)

EG:
Lua Code:
  1. -- Hide after 0.25 seconds outside of the tooltip or an LibDataBroker data object
  2. function LDB_DO:OnEnter(self)
  3.     tooltip = LibStub('LibQTip-1.0'):Acquire('MyFooBarTooltip', 5, "LEFT", "CENTER")
  4.     tooltip:SmartAnchorTo(self)
  5.     tooltip:SetAutoHideDelay(0.25, self)
  6.     DisplayTooltip() -- Tooltip population function
  7. end

The above code is from the LibQTip API reference.
  Reply With Quote