Rebol 编程/request-text
外观
< Rebol 编程
REQUEST-TEXT /offset xy /title title-text /default str
请求输入一个文本字符串。
REQUEST-TEXT 是一个函数值。
- /offset
- xy -- (类型:任何)
- /title
- title-text -- (类型:任何)
- /default
- str -- (类型:任何)
request-text: func [
"Requests a text string be entered."
/offset xy
/title title-text
/default str
][
if none? str [str: copy ""]
text-lay: layout compose [
across origin 10x10 space 2x4
h3 bold (either title [title-text] ["Enter text below:"])
return
tf: field 300 str [ok: yes hide-popup] with [flags: [return]] return
pad 194
btn-enter 50 [ok: yes hide-popup]
btn-cancel 50 #"^[" [hide-popup]
]
ok: no
focus tf
either offset [inform/offset text-lay xy] [inform text-lay]
all [ok tf/text]
]