You can query all layouts in the scene and then ask which ones have a parent
that is that window.
Something like this... but you'd probably just assign it to a know variable
in python when you created the layout in the first place.
import maya.cmds as cmds
# Create a simple window containing a single column layout
# and a few buttons.
#
window = cmds.window(title='Layout Example')
column = cmds.columnLayout()
cmds.button()
cmds.button()
cmds.button()
cmds.showWindow( window )
# If you don't know that the layout is actually a 'columnLayout' then
# you may use the 'layout' command to determine certain properties.
#
cmds.layout( column, query=True, numberOfChildren=True )
cmds.layout( column, query=True, childArray=True )
cmds.layout( column, query=True, height=True )
windowChildren=[]
layouts= cmds.lsUI(controlLayouts=True)
for layout in layouts:
if (cmds.layout(layout,q=True,p=True)== window):
windowChildren.append(layout)
print(windowChildren)
On Fri, Feb 6, 2009 at 10:09 PM, yury nedelin <[email protected]> wrote:
> thanks
>
> This will definitely help but getting all children from Window itself would
> be very handy.
>
> I wonder if there is a way to do it from API.
>
> Yury
>
>
>
>
> On Fri, Feb 6, 2009 at 5:27 PM, Tim Fowler <[email protected]> wrote:
>
>> Query the childArray of the top level layout.
>>
>> eg:
>>
>> {
>> window;
>> columnLayout MyWindowLayout;
>> button; button; button;
>> floatSlider;
>> showWindow;
>> }
>>
>> layout -query -childArray MyWindowLayout;
>> // Result: button5 button6 button7 floatSlider1 //
>>
>>
>> On Fri, Feb 6, 2009 at 7:57 PM, yury nedelin <[email protected]> wrote:
>>
>>> What is a good way to list all children of a Window in MEL UI?
>>>
>>> Yury
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---