From 767fcaa7a426a8612523d485da71e5004ab4408e Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sun, 18 Jan 2009 09:42:42 +0000 Subject: [PATCH] * Add support for the tooltip attribute --- NinjaPanel.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/NinjaPanel.lua b/NinjaPanel.lua index b08eff2..e45b2d2 100644 --- a/NinjaPanel.lua +++ b/NinjaPanel.lua @@ -180,7 +180,17 @@ function NinjaPanel:UpdatePlugin(event, name, key, value, dataobj) self:UpdateButtonWidth(button) elseif key == "icon" then button.icon:SetTexture(value) - -- TODO: Clean this up + elseif key == "tooltip" then + -- This means we have a custom frame to be displayed so we must handle the + -- showing/hiding and anchoring + button:SetScript("OnEnter", function(self) + value:ClearAllPoints() + value:SetPoint("TOPLEFT", button, "BOTTOMLEFT", 0, 0) + value:Show() + end) + button:SetScript("OnLeave", function(self) + value:Hide() + end) elseif key == "OnTooltipShow" and type(value) == "function" then button:SetScript("OnEnter", Button_OnEnter) button:SetScript("OnLeave", Button_OnLeave) -- 1.7.9.5