pymel.core.windows.setUITemplate

setUITemplate(*args, **kwargs)

This command sets the current(default) command template for the ELF commands. The special name NONE can be used to set no templates current. See uiTemplatecommand also.

Flags:
Long name (short name) Argument Types Properties
popTemplate (ppt) bool ../../../_images/create.gif
 

Pop the current template off of the stack and sets the next template on the stack to be current. Flag can have multiple arguments, passed either as a tuple or a list.

pushTemplate (pst) bool ../../../_images/create.gif
 
Push the current template onto a stack that can later be popped.

Derived from mel command maya.cmds.setUITemplate

Example:

import pymel.core as pm

#    Create a new template.
#
if pm.uiTemplate( 'ExampleTemplate', exists=True ):
    pm.deleteUI( 'ExampleTemplate', uiTemplate=True )

pm.uiTemplate( 'ExampleTemplate' )

pm.button( defineTemplate='ExampleTemplate', width=100, height=40, align='left' )
pm.frameLayout( defineTemplate='ExampleTemplate', borderVisible=True, labelVisible=False )

#    Create a window and apply the template.
#
window = pm.window()
pm.setUITemplate( 'ExampleTemplate', pushTemplate=True )
pm.columnLayout( rowSpacing=5 )

pm.frameLayout()
pm.columnLayout()
pm.button( label='One' )
pm.button( label='Two' )
pm.button( label='Three' )
pm.setParent( '..' )
pm.setParent( '..' )

pm.frameLayout()
pm.columnLayout()
pm.button( label='Red' )
pm.button( label='Green' )
pm.button( label='Blue' )
pm.setParent( '..' )
pm.setParent( '..' )

pm.setUITemplate( popTemplate=True )

pm.showWindow( window )

Previous topic

pymel.core.windows.setStartupMessage

Next topic

pymel.core.windows.shelfButton

Core

Core Modules

Other Modules

This Page