Assume that ECLiPSe is then resumed, writes to the queue and flushes it. This will briefly pass control back to Tcl, the ec_stream_to_window-handler will be executed (with the stream number added to its arguments), afterwards control is passed back to ECLiPSe. Note that ec_stream_to_window is a predefined handler which reads the whole queue contents and displays it in the given text widget.Tcl: pack [text .tout] ec_queue_create my_out_queue toec {ec_stream_to_window "" .tout} {}
Assume that ECLiPSe is then resumed and reads from my_in_queue. This will briefly yield control back to Tcl, the ec_stream_input_popup-handler will be executed, afterwards control is passed back to ECLiPSe.Tcl: ec_queue_connect my_in_queue fromec \ {ec_stream_input_popup "Type here:"} {}
Assuming something was written into the queue from within Tcl code, the ECLiPSe event will be handled if the queue is flushed on the Tcl side with the command ec_flush:Tcl: set my_out_channel [ec_queue_create my_queue toec {} my_queue_event]
If myqueue was empty, then the puts would raise the eventTcl: puts $my_out_channel hello ec_flush [ec_streamname_to_streamnum myqueue]
my_queue_event
. The ec_flush transfer control over to
ECLiPSe, so that the event can be handled.