python - Is there an option to recieve the data from a UI window to a variable? -


i saw possible print data has been written in user interface window, however, when searched in internet, none of options that, retrieve data variable.

this simple window code - '

def printtxtfield ( fieldid ):      print cmds.textfield( fieldid, query=true, text=true)  winid = 'kevsui'   if cmds.window(winid, exists=true):      cmds.deleteui(winid)   cmds.window(winid)  cmds.columnlayout()   whatusay = cmds.textfield() cmds.button(label='confirm', command='printtxtfield(whatusay)')  cmds.showwindow() 

'

i want retrieve data text field variable, once confirm button pressed.

up in cmds.button line, can see in command - 'print txtfield'. know if there option print written in text field, there must option put in variable instead. however, didn't find it.does knows how it?

sorry prev. question.

you have use partial module pass variable through button command (or lambda function)

from functools import partial 

here same question : maya python + pass variable on button press


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -