Go to: Synopsis. Return value. Python examples.

Synopsis

toggleWindowVisibility( [string] )

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

toggleWindowVisibility is undoable, NOT queryable, and NOT editable.

Toggle the visibility of a window. If no window is specified then the current window (most recently created) is used. See also the window command's vis/visible flag.

Return value

None

Python examples

import maya.cmds as cmds

window1 = cmds.window( retain=True )
cmds.columnLayout()
cmds.checkBox()
cmds.checkBox()
cmds.checkBox()
cmds.button( label='Close', command='cmds.window( window1, edit=True, visible=False )' )

#    Create another window with a button that will toggle the visibility
#    of the first window.
#
window2 = cmds.window()
cmds.columnLayout()
cmds.button( label='Toggle Window Visibility', command=('cmds.toggleWindowVisibility(\"' + window1 +'\")' ) )

cmds.showWindow( window1 )
cmds.showWindow( window2 )