How do I make a text input in a pupblock?

My code is this

def main():
    scn = Scene.GetCurrent()
    context = scn.getRenderingContext()
    
    
    PREF_START_FRAME = Draw.Create(context.sFrame)
    PREF_END_FRAME = Draw.Create(context.eFrame)
    
    PREF_SCMD = Draw.String("StartCmd", 0, 0, 0, 60, 20, "", 399)
    PREF_ECMD = Draw.String("EndCmd", 0, 0, 0, 60, 20, "", 399)
    
    if not Draw.PupBlock('Add render commands', [\
    ('Start:', PREF_START_FRAME, 1, 300000, 'Frame from where to start rendering the animation'),\
    ('End:', PREF_END_FRAME, 1, 300000, 'Frame where to end rendering the animation and execute the command'),\
#    ('Start command:', PREF_SCMD, 'Command to execute before starting the rendering process'),\
#    ('End command:', PREF_ECMD, 'Command to execute when the rendering process ends'),\
    ]):
        return
    

I tried making the last 2 ones draw.string, but it won’t work. How do I do it?

You know a great way to learn how to do these things is to pull down the mosaic.py script. There is a ton of useful code in that one script.
http://ribmosaic.cvs.sourceforge.net/viewvc/checkout/ribmosaic/mosaic/mosaic.py

isnt there anything simpler?

In my"assign materials" script there’s a text entry pupblock…


def createNewMaterial_ui():
    text = Draw.Create("NewMaterial" )

    block = []
   
    block.append(("Name: ", text, 0, 300, "the name of the material that will be created"))


    retval = Draw.PupBlock("Create New Material", block)

    name = str(text)[1:-1]
    return name 


this part: “name = str(text)[1:-1]” is probably not the “correct” way to get the value without the quotation marks, but a working script is a working script!