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

How come 'window-event won't let me have activate events?



Hello.  As you may know, I have been trying to find a way to replace the
functionality of several methods that were defined in MACL 1.2.2 but
are no longer defined in MACL 1.3.2.   The most important ones, at least
for my purposes, are:

  window-activate-event-handler, 
  window-deactivate-event-handler,
  window-control-click-event-handler

I thought the easiest way to do this would be to specialize 'window-event
on *window* and then add some simple code to test for an activate event
and call these methods directly.

  Very bad move.  It causes the system to hang.

So, I tried the following:

;; a few event types; not all of them
;;
(defconstant mouseDown 1)
(defconstant mouseUp 2)
(defconstant keyDown 3)
(defconstant keyUp 4)
(defconstant updateEvent 6)
(defconstant activateEvent 8)

;;  *fred-window* is immediate parent of *gp-pascal-window*
;;
(defobfun (window-event *gp-pascal-window*) ()
  (declare (special *current-event*))
  (let ((what (rref *current.event* Event.what))
        (mods (rref *current.event* Event.where)))
    (cond ((eq what updateEvent)
           (format t "*fred-window: updated    what=[~a] mods=[~a]" what mods))
          
          ((eq what activateEvent)
           (format t "*fred-window: activated  what=[~a] mods=[~a]" what mods))
          
          (t
           nil))))

BUT this won't detect activate events!!!!  Double and triple AGGGGHHH.

   Does this mean that I have to write my own global *event-hook*
   function to determine activate/deactivate events?

 --- Luke