Quantcast
WoWInterface - View Single Post - LibQTip tooltip hides when there is a script on line or cell
View Single Post
03-19-20, 03:41 PM   #5
gmarco
A Frostmaul Preserver
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 290
Hi,
Lua Code:
  1. local ADDON = ...
  2.  
  3. local function Button_OnClick(rowline, name, button)
  4.     print("Never arrives here")
  5. end
  6.  
  7. local LibQTip = LibStub('LibQTip-1.0')
  8. local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
  9.  
  10. local dataobj = ldb:NewDataObject(ADDON, {
  11.     type = "data source",
  12.     icon = "Interface\\Addons\\"..ADDON.."\\icon.tga",
  13.     text = "-"
  14. })
  15.  
  16. local function anchor_OnEnter(self)
  17.     local row,col
  18.     local tooltip = LibQTip:Acquire(ADDON.."tip", 4, "LEFT", "LEFT", "LEFT","LEFT")
  19.     self.tooltip = tooltip
  20.     tooltip:SmartAnchorTo(self)
  21.  
  22.     row,col = tooltip:AddHeader()
  23.     tooltip:SetCell(row,1,ADDON,"LEFT",4)
  24.    
  25.     row,col = tooltip:AddLine("var1","var2","var3","var4")
  26.     tooltip:SetLineScript(row, 'OnMouseDown', Button_OnClick, "var1")  
  27.     tooltip:SetHighlightTexture(1,1,0,.2)
  28.    
  29.     row,col = tooltip:Show()
  30.     tooltip:SetScript("OnLeave", function(self)
  31.     self:Release()
  32.     tooltip = nil
  33.     print("Release tooltip")
  34.     end)
  35.  
  36. end
  37.  
  38. dataobj.OnEnter = function(self)
  39.     anchor_OnEnter(self)
  40. end
  41.  
  42. dataobj.OnLeave = function(self)
  43.     print("Leaving/Hiding broker frame")
  44.     -- Null operation: Some LDB displays get cranky if this method is missing.
  45. end

The only print() that triggers when I mouse over the line with scripts is:

Lua Code:
  1. print("Release tooltip")

Can you explain better what you mean by:

The SetLineScript sets an OnEnter for the row highlight frame which posts an OnLeave to your data opbject.

I didn't find any references of this highlight frame in the libqtip docs.

And I really dont understand what I am doing wrong because all the others addons I am looking seems so similar to mine ... The only differences is that the others works as expected
And it is really frustrating )

Thanks so much for any help )
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote