Here's a bareboned example of what I'm trying to do.
Enter the values, press the button, create a cube. The problem is, I can't create a cube with the updated information in my fields. I'd like to avoid doing "mc.intField("n", query = True, value = True)" in the makeCube section if I can, but I'm not sure how else I can get the updated values in my fields.
import maya.cmds as mc
win = mc.window("exampleWin", title = "Help me!")
layout = mc.rowLayout(nc = 4)
nameField = mc.textField("n", text = "bobTheCube")
widthField = mc.intField("w")
heightField = mc.intField("h")
name = mc.textField("n", query = True, text = True)
width = mc.intField("w", query = True, value = True)
height = mc.intField("h", query = True, value = True)
doButton = mc.button(label = "Create Cube!", command = lambda x:makeCube(name, width, height) )
def makeCube(name, width, height, *args):
mc.polyCube(name = name, width = width, height = height)