[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Waiting for Interaction
- To: bam+@cs.cmu.edu (Brad Myers), info-mcl@ministry.cambridge.apple.com
- Subject: Re: Waiting for Interaction
- From: bill@cambridge.apple.com (Bill St. Clair)
- Date: Wed, 1 Jun 1994 13:01:22 -0400
At 2:12 PM 6/1/94 +0000, Brad Myers wrote:
>We have a complex interaction requirement that we can't figure out how to
>handle in MCL. Normally, an interface is set up so that all event handling is
>asynchronous and dispatched from the CLOS various event handlers. However,
>it is sometimes required to have an application wait for an interaction to
>be completed.
The following macros should help, with-event-processing-enabled
in particular. When an event handler is run, MCL's event-dispatch
code binds ccl::*processing-events* true, which disables recursive event
processing. with-event-processing-enabled below binds it to NIL to
allow recursive event processing.
-------------------------------------------------------------------------
; with-event-processing.lisp
;
; Macros to control event processing
(in-package :ccl)
(export '(without-event-processing 'with-event-processing-enabled))
(defmacro without-event-processing (&body body)
`(let ((*processing-events* t))
,@body))
(defmacro with-event-processing-enabled (&body body)
`(let ((*interrupt-level* 0))
(without-interrupts) ; startup kernel timer
(let ((*processing-events* nil))
,@body)))