-
Posted by mandok on Thu, 21 Aug 2008 14:39:00
I know I came across it earlier - but cannot find the reference....
In the XML file we have a line like this:
<Fontstring name="$parentName" inherits="GameFontHighlight" justifyH="LEFT">
Which is referred to in the code:
function TargetText:UpdateName ()
local name = UnitName ("target") or ""
TargetTextFrameName:SetText (name)
endSo just exactly how does "$parentName" of the Frame "TargetTextFrame" become "TargetTextFrameName"?
-
Posted by mandok on Thu, 21 Aug 2008 14:39:00
I know I came across it earlier - but cannot find the reference....
In the XML file we have a line like this:
<Fontstring name="$parentName" inherits="GameFontHighlight" justifyH="LEFT">
Which is referred to in the code:
function TargetText:UpdateName ()
local name = UnitName ("target") or ""
TargetTextFrameName:SetText (name)
endSo just exactly how does "$parentName" of the Frame "TargetTextFrame" become "TargetTextFrameName"?
-
Posted by jnwhiteh on Thu, 21 Aug 2008 17:36:31
Blizzard's XML system does this automatically. Page 163 contains more information about why templates are useful and how the $parent attribute helps us there. In those cases, we can create a simple template set up to use $parent, and then when we inherit from it, all of the sub-frames are automagically named correctly.