Changeset 14219


Ignore:
Timestamp:
Aug 26, 2010, 8:54:04 AM (9 years ago)
Author:
arthur
Message:

add ability for button actions to use shift-key-p and friends

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/examples/cocoa/easygui/action-targets.lisp

    r7325 r14219  
    55
    66(defclass generic-easygui-target (ns:ns-object)
    7      ((handler :initarg :handler :reader target-handler))
     7     ((handler :initarg :handler :reader target-handler)
     8      (shooter :initarg :shooter :reader target-shooter))
    89  (:metaclass ns:+ns-object))
    910
    1011(objc:defmethod (#/activateAction :void) ((self generic-easygui-target))
    11   (funcall (target-handler self)))
     12  (let* ((cell (#/selectedCell (target-shooter self)))
     13         (responds (#/respondsToSelector: cell (@selector #/mouseDownFlags)))
     14         (*modifier-key-pattern* (if responds (#/mouseDownFlags cell) 0)))
     15    (funcall (target-handler self))))
    1216
    1317(defmethod (setf action) (handler (view view))
    1418  (let ((target (make-instance 'generic-easygui-target
    15                    :handler handler)))
     19                   :handler handler :shooter (cocoa-ref view))))
    1620    (#/setTarget: (cocoa-ref view) target)
    1721    (#/setAction: (cocoa-ref view) (@selector #/activateAction))))
Note: See TracChangeset for help on using the changeset viewer.