[REBOL] View / User prompt help!!!
From: bkalef:sympatico:ca at: 6-Mar-2002 12:47
I am trying to use secondary views to retrieve user input. Is there a
better way to do this than the way I am trying below. Simply, a main view
window launches two separate view windows to retrieve user input. However,
the two sub views return immediately and don't wait for user input. I've
tried adding the 'do-event word after the 'layout of get-input but it only
allows the retrieval of the first variable (this snippet isn't working
perfectly either as it isn't returning the first variable). Anyway, any
help/alternative approaches is appreciated.
Brock Kalef
__________
rebol[]
sched-styles: stylize [
but: button 200x18 font-size 9 edge [size: 1x1]
fld: field 100x18 font-size 9 edge [size: 1x1]
txt: text font-size 9
]
test: layout [
button "Try" [data]
]
get-input: func [message [string!] /local return-var input-view] [
print "Now in get-input function"
input-view: layout [
styles sched-styles
text :message
return-var: fld
button "OK" [unview input-view]
]
print return-var/text
focus return-var
view input-view
do-events ; stops execution until gui events have completed.
:return-var/text
]
data: does [
until [
fday: get-input "Enter FIRST day to schedule (MM-DD): "
print "FDAY: " fday
fday
]
until [
lday: get-input "Enter last day to schedule ([YYYY-]MM-DD): "
print "LDAY: " lday
lday
]
]
view test