Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-04-07, 05:54 AM   #1
MartijnGP
A Kobold Labourer
Join Date: Jan 2007
Posts: 1
How to find a frame's children?

I need to know all the children of the Minimap frame. When looking around I found the function API GetChildren(), but I can't get it to work. I tried the following script in a macro to see if it would have any result at all.

Code:
/run kids = { Minimap:GetChildren() };for _,framechild in ipairs(kids) do mgui_consolemsg("-"..framechild); end
Note: the mgui_consolemsg function prints the input into the chatframe, and I'm 100% sure that works, so that's not the problem.

Which should, according to explanations I found about this function, print a list of names of the frames that have the minimap as their parent. But it doesn't, it says the framechild is a table value, but when I extract that using foreach, it's completely empty.

Does anyone know how to fix this, or possibly another way to find which frames have the Minimap as parent? It doesn't need to be a fast and efficient code, as it will only be ran once during the installation part of this addon, and not during gameplay.
 
 

WoWInterface » Developer Discussions » Lua/XML Help » How to find a frame's children?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off