[REBOL] Re: Interrupting an action
From: agem:crosswinds at: 15-Jul-2001 15:11
RE: [REBOL] Interrupting an action
> Hi all,
> If I've got a VID action facet that takes a long time, how can I provide the
> user with some way of aborting the action?
> I've tried polling the Console as per the KBHIT thread of some weeks ago. But
> that takes input from the Console, not the layout.
> So what code can I use to replace the comment below?
> > unview/all
> view layout [
> Button "long wait"
> ResultField/Text: "Working" show resultField
> loop 100
> [ wait 1
> ;;check for escape key/cancel button
> ] ;loop
> ResultField/Text: "Finished" show resultField
> resultField: info
view layout [
Button "long wait"
ResultField/Text: "Working" show resultField
i: i + 1
;only all 100 steps os-call
if i // 100 [
if stop [break]
prin random "*?!#@+&()\"
pick ["Interrupted" "Finished"] stop
button "stop" [