interactor


Vocabulary
ui.tools.listener

Class description
An interactor is an editor intended to be used as the input component of a UI listener. It has the following slots:
waitingIf waiting is t, the interactor is waiting for user input, and invoking evaluate-input resumes the thread.

Interactors are created by calling <interactor>.

Interactors implement the stream-readln, stream-read and stream-read-quot generic words.

Definition


TUPLE: interactor < source-editor
output history flag mailbox thread waiting token-model
word-model popup ;


Methods



















M:: interactor stream-read-unsafe
( n buf interactor -- count )
n
[ 0 ] [
drop interactor interactor-read dup [ "\n" join ] when
n short [ head-slice 0 buf copy ] keep
] if-zero ;