Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Flushing the event queue

 [1/1] from: Christophe::Coussement::mil::be at: 26-Jan-2006 10:11


I did contact REBOL Feedback for help regarding our problems (see thread Request info about Crash (Should not happened)" error"). My question was: how dod I clear the event queue. Here is the answer, I hope this will be useful to somebody: [quote] One thing to check is that you do not call WAIT during the processing of the event inside ENGAGE or any other feel function. That is, in theory, you should never call WAIT in your code anywhere except the one that is inside of DO-EVENTS. (And of course, DO-EVENTS should only appear once in your code if you use VIEW/new to start.) With regard to the idea of clearing the event queue, it is possible. But, it can also be a problem, because what if the user clicked on something or pressed a key? It would be lost. The event queue is actually a port, but the CLEAR action is not allowed for it. However, you can still remove all the events by calling PICK on it until NONE is returned: until [none? pick system/view/event-port 1] [end-quote] --christophe This e-mail and any attachments may contain confidential and privileged information. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal.