View Single Post
02-13-11, 12:33 AM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
$parent is a key that gets replaced by the name of that widget's parent.

I don't use XML, so this is just some generic pseudo-code, but I think you'll get the gist.

Code:
<Frame="MyFrame">
     <Button="$parentButton">
          <Scripts>
               <OnClick>--dostuff</OnClick>
          </Scripts>
     </Button>
</Frame>
The button's name is MyFrameButton.

To get the name of something's parent via Lua, you do widget:GetParent().


/edit: heh - Xrystal and I used the same example!
/edit2: note - $parent only works in XML, not Lua.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote