PDA

View Full Version : Wait for intField input


CadOp
11-07-2011, 04:02 AM
Hey,

I am trying to write a python script that will wait for a user input or a button click. Currently both windows appear at the same time, and the for loop finishes. I tried using a while loop with pass but that crashed. Actually, I tried 3 different iterations of loops and statements that all crashed my computer. Any Ideas?

the setup now is something like this:

window1=cmds.window(title="My Window", iconName='my win')
cmds.columnLayout(width=500, height=500)
WindowInput=cmds.intField()
cmds.button(label='My Value',command='myfunc_1')

window2=cmds.window(title="My Window2", iconName='my win2')
cmds.columnLayout(width=500, height=500)
Window2Input=cmds.intField()
cmds.button(label='My Value2',command='myfunc_2')

for i in range(len(mylen)):
cmds.showWindow(window1)
cmds.showWindow(window2)

NaughtyNathan
11-07-2011, 12:27 PM
sounds like you're after a modal dialog, so you'll need to use the promptDialog (or layoutDialog) command rather than standard UI.

:nathaN

CadOp
11-16-2011, 04:18 PM
Thanks that worked out. :)

CGTalk Moderation
11-16-2011, 04:18 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.