pymel.core.windows.setFocus

setFocus(*args, **kwargs)

Give keyboard focus to a specific control or panel, passed as an argument.

Derived from mel command maya.cmds.setFocus

Example:

import pymel.core as pm

import maya.cmds as cmds

pm.window()
# Result: ui.Window('window1') #
pm.columnLayout()
# Result: ui.ColumnLayout('window1|columnLayout79') #
pm.textField('tf0', changeCommand='pm.setFocus("tf1")' )
# Result: ui.TextField('window1|columnLayout79|tf0') #
pm.textField('tf1', changeCommand='pm.setFocus("tf2")' )
# Result: ui.TextField('window1|columnLayout79|tf1') #
pm.textField('tf2', changeCommand='pm.setFocus("tf0")' )
# Result: ui.TextField('window1|columnLayout79|tf2') #
pm.showWindow()

Previous topic

pymel.core.windows.separator

Next topic

pymel.core.windows.setMenuMode

Core

Core Modules

Other Modules

This Page