[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Apple events in toplevel loops
- Subject: Apple events in toplevel loops
- From: firstname.lastname@example.org (Ralf Moeller)
- Date: Wed, 16 Jun 1993 13:28:13 +0100
Writing an application (without a Listener) in MCL requires a new toplevel
loop. I tried the following (adapted from the Binhex application).
(defun application-toplevel ()
(catch-cancel (event-dispatch t)))
(defun application-toplevel-startup ()
(let ((finder-parameters (finder-parameters)))
(when (eq (car finder-parameters) ':open)
(dolist (file (cdr finder-parameters))
(when (eq (mac-file-type file)
The application is saved with:
Everything works fine, even resources (icons etc.) are handled correctly :-)
However, my simple toplevel loop does not care for apple events like |:odoc|.
This is necessary to handle open document events (e.g., via double clicking
the mouse) when the application is already running.
The documentation (page 413) says that MCL does its own dispatching.
"Lisp takes care of both dispatching and run-time error checking."
These events are indeed handled when MCL's native toplevel-loop is
installed. However, I cannot use #'toplevel-loop because a listener is
created when it is installed.
Unfortunately, the code for this function is not available.
Can someone give me a hint how the handler for apple events can be kept alive
in an application without a Listener?