Rebol 程式設計/request-text
外觀
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]
]