-
Posted by bellah on Mon, 16 Feb 2009 11:15:30
This one has my completely mystified: I've got a FauxScrollPane with a bunch of buttons in it and I want to show some data on the currently selected entry on Mouseover.
I can get the tooltip to display exactly once. When I hide it, it will not display anymore. As long as I don't hide the panel and just use ClearLines(), everything is ok and data is displayed exactly as I want it. Downside is that I've got this gray half-transparent rectangle hanging off my cursor :(
Changing the code to directly using GameTooltip worked, except that I doesn't display as long as I haven't 'touched' a game object, and it shows the last touched object's name in the tooltip header instead of my own header.
I've tried changing the owner to UIParent, but that didn't help. Changing Anchors didn't help either.
Am I missing something obvious here?
Any help would be appreciated.
Below is the code to fill/display/hide the tooltip.
===========
local function updateTooltip (id, entering)
if entering then
if not bListTooltip then
bListTooltip = CreateFrame("GameTooltip", fName .. "Tooltip", UIParent, "GameTooltipTemplate")
bListTooltip:SetOwner(bListFrame, "ANCHOR_CURSOR")
end
local userDKP, dateCollected = addon:GetDKPData(bNames[id + offset])
-- bail out if no dkp data returned
if not userDKP then return end
bListTooltip:AddLine("User DKP for " .. userDKP["Name"])
for i,j in pairs(userDKP) do
bListTooltip:AddDoubleLine(i,j)
end
bListTooltip:AddLine("DKP collected: " .. dateCollected)
bListTooltip:Show()
else
bListTooltip:Hide()
bListTooltip:ClearLines()
end
end====================
Complete addon source can be found at http://code.google.com/p/whisperloot3/
-
Posted by bellah on Mon, 16 Feb 2009 11:15:30
This one has my completely mystified: I've got a FauxScrollPane with a bunch of buttons in it and I want to show some data on the currently selected entry on Mouseover.
I can get the tooltip to display exactly once. When I hide it, it will not display anymore. As long as I don't hide the panel and just use ClearLines(), everything is ok and data is displayed exactly as I want it. Downside is that I've got this gray half-transparent rectangle hanging off my cursor :(
Changing the code to directly using GameTooltip worked, except that I doesn't display as long as I haven't 'touched' a game object, and it shows the last touched object's name in the tooltip header instead of my own header.
I've tried changing the owner to UIParent, but that didn't help. Changing Anchors didn't help either.
Am I missing something obvious here?
Any help would be appreciated.
Below is the code to fill/display/hide the tooltip.
===========
local function updateTooltip (id, entering)
if entering then
if not bListTooltip then
bListTooltip = CreateFrame("GameTooltip", fName .. "Tooltip", UIParent, "GameTooltipTemplate")
bListTooltip:SetOwner(bListFrame, "ANCHOR_CURSOR")
end
local userDKP, dateCollected = addon:GetDKPData(bNames[id + offset])
-- bail out if no dkp data returned
if not userDKP then return end
bListTooltip:AddLine("User DKP for " .. userDKP["Name"])
for i,j in pairs(userDKP) do
bListTooltip:AddDoubleLine(i,j)
end
bListTooltip:AddLine("DKP collected: " .. dateCollected)
bListTooltip:Show()
else
bListTooltip:Hide()
bListTooltip:ClearLines()
end
end====================
Complete addon source can be found at http://code.google.com/p/whisperloot3/
-
Posted by jnwhiteh on Mon, 16 Feb 2009 14:39:21
You must run
SetOwner()
every single time you want to display the tooltip, not just when it is created as far as I recall. Can you please test that for us? -
Posted by bellah on Tue, 17 Feb 2009 05:05:23
With your suggestion I changed the code to
if not bListTooltip then
bListTooltip = CreateFrame("GameTooltip", fName .. "Tooltip", UIParent, "GameTooltipTemplate")
end
bListTooltip:SetOwner(bListFrame, "ANCHOR_CURSOR")and it works like a charm, jnwhiteh. Thanks a lot!