Originally Posted by
Treeston
Can't seem to see any OnEnter/OnLeave handlers. Are they defined by UICheckButtonTemplate?
<snip>
Can't seem to
find any:
<snip>
Treeston to the rescue again... Thanks m8... ;o)
No they are not defined by UICheckButtonTemplate, is UICheckButtonTemplate not just a standard "layout" or is it me there still don't get it ?
But now the OnEnter/OnLeave is working almost as i want them to (after i added them).
I have made it as a separate function so i don't have to add the to every checkbutton
Code:
function OnEnter(self)
GameTooltip:ClearLines()
GameTooltip:SetOwner(self,"ANCHOR_RIGHT")
GameTooltip:AddLine(SetGsGuildText:GetText(),1,0.82,0)
GameTooltip:AddLine(self.tooltip,1,1,1)
GameTooltip:Show()
end
function OnLeave()
GameTooltip:Hide()
end
but can't get the "GetText" to work, so i tryed with this
Code:
-- ********************* * * * * * Do your stuf * * * * * ********************
local GsGuild = CreateFrame("CheckButton", "SetGsGuild", Window, "UICheckButtonTemplate")
strText = "Text line here"
GsGuild:SetScript("OnEnter", OnEnter(strText));
GsGuild:SetScript("OnLeave", OnLeave);
GsGuild:SetPoint("TOPLEFT", Window, "TOPLEFT", 10, -30)
GsGuild.tooltip = "Tooltip here, now it's working ?";
if (GS_InGuild:lower() == "on") then
GsGuild:SetChecked(true)
else
GsGuild:SetChecked(false)
end
SetGsGuildText:SetText(strText);
GsGuild:SetScript("OnClick", function()
if (GsGuild:GetChecked() == 1) then
GS_InGuild = "on"
elseif (GsGuild:GetChecked() == nil) then
GS_InGuild = "off"
else
print("Error");
end
end)
end
function OnEnter(self, strText)
GameTooltip:ClearLines()
GameTooltip:SetOwner(self,"ANCHOR_RIGHT")
GameTooltip:AddLine(strText,1,0.82,0)
GameTooltip:AddLine(self.tooltip,1,1,1)
GameTooltip:Show()
end
But the "GetText" is it still not working, any ide how to make it work ?