Johns script should only ever find 1 layout so it shouldn't bother appending
to an array in that loop.  It should just return the first string that it
finds.
To list all of the controls which are children of a window you need the top
level layout and then call something like this.

global proc string[] getAllChildControls(string $layout)
{
    string $controls[];
    string $children[] = `layout -q -childArray $layout`;

    for ($child in $children)
    {
       if (`layout -q -exists $child`)
       {
          $controls = stringArrayCatenate($controls,
getAllChildren($child));
       }
       else if (`control -q -exists $child`)
       {
          $controls[size($controls)] = $child;
       }
    }

    return $controls;
}


On Fri, Feb 6, 2009 at 11:36 PM, yury nedelin <[email protected]> wrote:

> awesome this is very helpful,
>
> I was going to just write one like that if there is no clever command
> somewhere hidden away.
>
> thanks Brian

--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---

Reply via email to