Hi all.
Being confined in home in Italy in this period (and I stayed in home also from november to january with a broken leg)
I decided to rewrite some of my addons in a (better) way.
I try to use LibQTip again where possible to expand the possibilities of them (I had tried in the past too
.
The first experiment I have done is a little guild and friends ldb and it works:
Now I'd like to implement the possibility to whisper and invite clicking on the row of the names but when I mouse over on the line the tooltip close.
This is a small sample code that I have used:
Lua Code:
local ADDON = ...
local function Button_OnClick(rowline, name, button)
print("Never arrives here")
end
local LibQTip = LibStub('LibQTip-1.0')
local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
local dataobj = ldb:NewDataObject(ADDON, {
type = "data source",
icon = "Interface\\Addons\\"..ADDON.."\\icon.tga",
text = "-"
})
local function anchor_OnEnter(self)
local row,col
local tooltip = LibQTip:Acquire(ADDON.."tip", 4, "LEFT", "LEFT", "LEFT","LEFT")
self.tooltip = tooltip
tooltip:SmartAnchorTo(self)
row,col = tooltip:AddHeader()
tooltip:SetCell(row,1,ADDON,"LEFT",4)
row,col = tooltip:AddLine("var1","var2","var3","var4")
tooltip:SetLineScript(row, 'OnMouseDown', Button_OnClick, "var1")
tooltip:SetScript("OnLeave", function(self) self:Release() tooltip = nil end)
row,col = tooltip:Show()
end
dataobj.OnEnter = function(self)
anchor_OnEnter(self)
end
dataobj.OnLeave = function(self)
-- Null operation: Some LDB displays get cranky if this method is missing.
end
The tooltip is shown until I dont over with the mouse on line:
"var1","var2","var3","var4"
and it works fine ...
when I pass on that line it disappears. No need to click.
The print inside is never called.
If I remove the function I can on mouse over, no error but the tooltip remain.
I check also a lot of others libqtip addons and I see they have the line colored when there is a script running on the cell or on the line even if I see no evidence in the code, while I was not able to reproduce it.
I am missing something but even if I have read and search a lot I could not figure out the solution for the problem.
Every input is welcome as usually.
Thanks so much at everyone.