pymel.core.windows.toggleWindowVisibility

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|columnLayout90') #
pm.checkBox()
# Result: ui.CheckBox('window1|columnLayout90|checkBox8') #
pm.checkBox()
# Result: ui.CheckBox('window1|columnLayout90|checkBox9') #
pm.checkBox()
# Result: ui.CheckBox('window1|columnLayout90|checkBox10') #
pm.button( label='Close', command='pm.window( window1, edit=True, visible=False )' )
# Result: ui.Button('window1|columnLayout90|button102') #

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

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