maya Creating Maya UI Widget naming


Example

When you create a new widget with a UI command you can supply the name you'd like the new widget to get. However, its not guaranteed: Maya will give the button the name you asked for -- if you've given it a character it doesn't recognize or if there is already a widget with the same name you may get back a different name. It always a good practice to capture the name of a new widget when it's created to avoid surprises:

 my_button = cmds.button('my_button') 
 cmds.button(my_button, e=True, label = "a new label")