pymel.core.windows.setFocus

static windows.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

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

Previous topic

pymel.core.windows.separator

Next topic

pymel.core.windows.setMenuMode

Core

Core Modules

Other Modules

This Page