InputDialog

From sfx
Jump to navigation Jump to search

fx.getInput() is a very powerful function for getting various pieces of information from the user.

<source lang="python" enclose> num = { "id" : "num", "label" : "Number", "value" : 42} str = { "id" : "str", "label" : "String", "value" : "Foo"} bool = { "id" : "bool","label" : "Bool", "value" : True } list = { "id" : "list", "label" : "List", "value" : "Friday", "items" : [ "Monday", "Wednesday", "Friday", "Saturday"] }

fields = [ num, str, bool, list ]

result = getInput(fields=fields)

result = getInput(title="Title", msg="Message", fields=fields, okText="OK", cancelText="Cancel") print result </source>