CLIM mail archive
[Prev][Next][Index][Thread]
No Subject
Date: Fri, 11 Mar 1994 08:13-0600
From: Nichael Cramer <ncramer@BBN.COM>
I need to figure out how to abort the currently-running
input-process of a frame from outside the frame.
For example, assume that I have two frames, call them EDITOR-1 and
EDITOR-2. Each editor works independently, however each editor can
"call" the other --i.e. EDITOR-1 can tell EDITOR-2 to start editing
OBJECT-X (and vice versa).
We have set up a general "interprocedure call" mechanism for handling
this kind of stuff. Basically, each application frame has a queue upon
which other frames can stick closures to be funcalled. The applications
check the queue via advice on CLIM-INTERNALS::TRACKING-POINTER-1 (you'll
need source or a good disassembler to figure out how to do that) and
CLIM:STREAM-INPUT-WAIT. It appears to be safe to throw out of these
contexts.
Be careful to consider the UI design implications of such a set-up.
Folks like immediate gratification for their actions, and there are all
kinds of strange and annoying failure modes that can happen when a bunch
of commands get queued up.
If you need to be able to talk to another frame while it is not waiting
for input or tracking the mouse, you'll need to interrupt the process.
Most CL's with multiple threads have some way of doing that. Here are
some common ones:
(defun interrupt-process (process function &rest args)
"Run FUNCTION in PROCESS."
#+Genera (apply #'process:process-interrupt process function args)
#+Lucid (apply #'lcl:interrupt-process process function args)
#+Allegro (apply #'mp:process-interrupt process function args)
#-(or Genera Lucid Allegro)
(error "Don't know how to do ~S." 'interrupt-process)
)
--David Gadbois
Follow-Ups:
Main Index |
Thread Index