pymel.core.windows.toggleWindowVisibility

static windows.toggleWindowVisibility(*args, **kwargs)

Toggle the visibility of a window. If no window is specified then the current window (most recently created) is used. See also the windowcommand’s vis/visibleflag.

Derived from mel command maya.cmds.toggleWindowVisibility

Example:

import pymel.core as pm

window1 = pm.window( retain=True )
pm.columnLayout()
# Result: ui.ColumnLayout('window1|columnLayout19') #
pm.checkBox()
# Result: ui.CheckBox('window1|columnLayout19|checkBox1') #
pm.checkBox()
# Result: ui.CheckBox('window1|columnLayout19|checkBox2') #
pm.checkBox()
# Result: ui.CheckBox('window1|columnLayout19|checkBox3') #
pm.button( label='Close', command='pm.window( window1, edit=True, visible=False )' )
# Result: ui.Button('window1|columnLayout19|button32') #

#    Create another window with a button that will toggle the visibility
#    of the first window.
#
window2 = pm.window()
pm.columnLayout()
# Result: ui.ColumnLayout('window2|columnLayout20') #
pm.button( label='Toggle Window Visibility', command=('pm.toggleWindowVisibility(\"' + window1 +'\")' ) )
# Result: ui.Button('window2|columnLayout20|button33') #

pm.showWindow( window1 )
pm.showWindow( window2 )

Previous topic

pymel.core.windows.toQtWindow

Next topic

pymel.core.windows.toolBar

Core

Core Modules

Other Modules

This Page