I've been beating my head against a wall on this problem for several hours now, and I just can't figure it out. Maybe someone else can help.
My add-on provides an LDB data object that renders it's tooltip using Tablet-2.0. (And before you ask, I actually do use just about every feature Tablet has.) All was working great until I tried to get my tooltip to detach. I've been all through the Tablet code and even through the LibFuBarPlugin-3.0 code trying to see how this is done. I've tested with FuBar + Broker2FuBar as well as with Fortress. Both yield exactly the same behavior, so it must be something I'm doing wrong.
When I attempt to detach, the tooltip goes away and doesn't show as a detached frame. When I attempt to reattach, I get an error:
[2008/11/25 21:28:26-1133-x1]: QuestAgent-19\QuestAgent.lua:1084: Tablet-2.0: Detached tooltip has no owner.
FuBar-3.0.90012\libs\AceLibrary\AceLibrary.lua:122: in function `error'
Tablet-2.0-90216 (FuBar):2317: in function `Attach'
Tablet-2.0-90216 (FuBar):2838: in function `Attach'
......
It appears that this error results when Tablet's registry[parent].tooltip.owner field is not present, but that object isn't exposed to me so I don't think I'm supposed to be setting it.
I'm registering the tablet like this when I create the LDB object:
[PHP]
local tabletRegistered, tipFrame
brokerPlugin.OnEnter = function(frame)
if not frame then return end
if not tabletRegistered then
tablet:Register(frame,
"children", function()
self:UpdateTooltip()
end,
"detachedData", self.db and self.db.profile.detachedTooltip or {},
"point", function(frame)
if frame:GetTop() > GetScreenHeight() / 2 then
local x = frame:GetCenter()
if x < GetScreenWidth() / 3 then
return "TOPLEFT", "BOTTOMLEFT"
elseif x < GetScreenWidth() * 2 / 3 then
return "TOP", "BOTTOM"
else
return "TOPRIGHT", "BOTTOMRIGHT"
end
else
local x = frame:GetCenter()
if x < GetScreenWidth() / 3 then
return "BOTTOMLEFT", "TOPLEFT"
elseif x < GetScreenWidth() * 2 / 3 then
return "BOTTOM", "TOP"
else
return "BOTTOMRIGHT", "TOPRIGHT"
end
end
end,
"clickable", true,
"hideWhenEmpty", true
)
tabletRegistered = true
end
tipFrame = frame
end
[/PHP]
My attach/detach method looks like this:
[PHP]
if tipFrame ~= nil then
if self.db.profile.detachTooltip and tablet:IsAttached(tipFrame) then
tablet:Detach(tipFrame)
elseif not self.db.profile.detachTooltip and not tablet:IsAttached(tipFrame) then
tablet:Attach(tipFrame)
end
end
[/PHP]
LibFuBarPlugin-3.0 does exactly this as far as I can tell -- it's really that simple. I'm following the Tablet API correctly. Google and searching this forum turns up nothing. I'm sure I'm missing something glaringly obvious here. I can provide more of the code if that'll help.
Turned out to be a simple problem. Even though the Tablet API documentation specifically says that calling Detach will open the tip, it doesn't in my case. Manually opening the tip prior to detaching it solves all the issues.
My add-on provides an LDB data object that renders it's tooltip using Tablet-2.0. (And before you ask, I actually do use just about every feature Tablet has.) All was working great until I tried to get my tooltip to detach. I've been all through the Tablet code and even through the LibFuBarPlugin-3.0 code trying to see how this is done. I've tested with FuBar + Broker2FuBar as well as with Fortress. Both yield exactly the same behavior, so it must be something I'm doing wrong.
When I attempt to detach, the tooltip goes away and doesn't show as a detached frame. When I attempt to reattach, I get an error:
It appears that this error results when Tablet's registry[parent].tooltip.owner field is not present, but that object isn't exposed to me so I don't think I'm supposed to be setting it.
I'm registering the tablet like this when I create the LDB object:
[PHP]
local tabletRegistered, tipFrame
brokerPlugin.OnEnter = function(frame)
if not frame then return end
if not tabletRegistered then
tablet:Register(frame,
"children", function()
self:UpdateTooltip()
end,
"detachedData", self.db and self.db.profile.detachedTooltip or {},
"point", function(frame)
if frame:GetTop() > GetScreenHeight() / 2 then
local x = frame:GetCenter()
if x < GetScreenWidth() / 3 then
return "TOPLEFT", "BOTTOMLEFT"
elseif x < GetScreenWidth() * 2 / 3 then
return "TOP", "BOTTOM"
else
return "TOPRIGHT", "BOTTOMRIGHT"
end
else
local x = frame:GetCenter()
if x < GetScreenWidth() / 3 then
return "BOTTOMLEFT", "TOPLEFT"
elseif x < GetScreenWidth() * 2 / 3 then
return "BOTTOM", "TOP"
else
return "BOTTOMRIGHT", "TOPRIGHT"
end
end
end,
"clickable", true,
"hideWhenEmpty", true
)
tabletRegistered = true
end
tipFrame = frame
end
[/PHP]
My attach/detach method looks like this:
[PHP]
if tipFrame ~= nil then
if self.db.profile.detachTooltip and tablet:IsAttached(tipFrame) then
tablet:Detach(tipFrame)
elseif not self.db.profile.detachTooltip and not tablet:IsAttached(tipFrame) then
tablet:Attach(tipFrame)
end
end
[/PHP]
LibFuBarPlugin-3.0 does exactly this as far as I can tell -- it's really that simple. I'm following the Tablet API correctly. Google and searching this forum turns up nothing. I'm sure I'm missing something glaringly obvious here. I can provide more of the code if that'll help.
[PHP]
tablet:Open(tipFrame)
tablet:Detach(tipFrame)
[/PHP]