Hi guys,
i want to use SetTexture on the my XML-Button-Template:
Code:
<!-- Template -->
<Button name="ToolbarButtonTemplate" virtual="true">
<Size>
<AbsDimension x="26" y="26" />
</Size>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentIcon">
<Size>
<AbsDimension x="20" y="20" />
</Size>
<Anchors>
<Anchor point="CENTER" />
</Anchors>
</Texture>
</Layer>
</Layers>
<Backdrop edgeFile="Interface\AddOns\MarkBar\tex\border.tga" tile="false">
<EdgeSize>
<AbsValue val="10" />
</EdgeSize>
</Backdrop>
<Scripts>
<OnLoad>
MarkBar.MarkOnLoad(self);
</OnLoad>
</Scripts>
<!-- Some More Scripts -->
</Button>
<!-- Button -->
<Button name="MarkBarMarkM1" inherits="ToolbarButtonTemplate" id="1">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="186" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
OnLoad run this script:
Code:
function MarkBar.MarkOnLoad(self)
local frame = self:GetName();
local id = self:GetID();
local icon = frame.."Icon";
local path = "Interface\\AddOns\\MarkBar\\tex\\"..id..".tga";
self:SetTexture(path, false);
end
And some other stuff, but have nothing to do with the SetTexture() stuff.
With this code, i getting a nil value for SetTexture(), even when i hardcode the path ("Interface\\AddOns\\MarkBar\\tex\1.tga"). Whats wrong with that?
Sry for the bad english. itīs a quite while since i used english for describing a problem