Difference between revisions of "InputDialog"

From Silhouette Wiki
Jump to navigation Jump to search
(Created page with "fx.getInput() is a very powerful function for getting various pieces of information from the user. num = { "id" : "num", "label" : "Number", "value" : 42} str = { "id" : "str...")
 
 
Line 1: Line 1:
 
fx.getInput() is a very powerful function for getting various pieces of information from the user.
 
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}
 
num = { "id" : "num", "label" : "Number", "value" : 42}
 
str = { "id" : "str", "label" : "String", "value" : "Foo"}
 
str = { "id" : "str", "label" : "String", "value" : "Foo"}
Line 12: Line 13:
 
result = getInput(title="Title", msg="Message", fields=fields, okText="OK", cancelText="Cancel")
 
result = getInput(title="Title", msg="Message", fields=fields, okText="OK", cancelText="Cancel")
 
print result
 
print result
 +
</source>

Latest revision as of 15:27, 30 May 2016

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

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