[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Graphics questions +



>4) (Aborting event processing)
>Huh ? Event processing is some System thing below the Lisp level. There is
>nothing to abort and restart. Do you mean abort the processing of one event ?

The Abort Event Processing restart aborts event processing for only
the current event.

>8) (Mouse up & down)
>The event record contains the global mouse coordinates in both cases (It might
>not be in a window at all), but MCL converts the mouse down to local before
>calling the view click handler. To do the same for mouse up, you can use the
>GlobalToLocal trap.

MCL doesn't do as much work for you on mouse up events as it does
on mouse down events. This assymetry is probably what confuses you.
You may want to define a window-mouse-down-event-handler that
calls view-unclick-event-handler (to coin a name):

(defclass mouse-up-window (window) ())

(defmethod view-unclick-event-handler ((view t) where)
  (declare (ignore where))
  nil)

; If you prefer to change the mouse-up behavior globally,
; specialize this method on WINDOW instead of MOUSE-UP-WINDOW.
; You'll need to bind *warn-if-redefine* and *warn-if-redefine-kernel*
; to NIL around the definition or a continuable error will be signalled.
(defmethod window-mouse-up-event-handler ((w mouse-up-window))
  (view-unclick-event-handler
    w
    (ccl::%local-to-global
     (wptr w) (pref *current-event* :eventRecord.where))))