Changeset 11797 for release/1.2


Ignore:
Timestamp:
Feb 27, 2009, 12:32:15 PM (10 years ago)
Author:
cater
Message:

Let easygui views inherit mouse handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/1.2/source/examples/cocoa/easygui/events.lisp

    r7499 r11797  
    11(in-package :easygui)
     2
     3;;; Changed by AWSC Feb 2009:
     4;;; Modified define-chaining-responder-method to allow subclasses of easygui
     5;;; views to inherit mouse handling behaviour.
     6;;; Original work by an unknown author.
     7;;; Permission to use the change is granted.
    28
    39;;; Event handling basics
     
    915  `(objc:defmethod (,objc-name :void) ((,self-arg ,class-name)
    1016                                       ,event-arg)
    11      (let ((ev-class (class-name
    12                       (class-of (easygui-view-of ,self-arg)))))
    13        (if (find-method #',lisp-name nil `(,ev-class) nil) ; TODO: doesn't consider subclasses.
     17     (let ((superclasses (ccl:class-precedence-list (class-of (easygui-view-of ,self-arg)))))
     18       (if (some #'(lambda (super)
     19                     (find-method #',lisp-name nil (list (class-name super)) nil))
     20                 superclasses)
    1421           (,lisp-name (easygui-view-of ,self-arg)
    1522                     ,@arg-compute-forms)
Note: See TracChangeset for help on using the changeset viewer.