source: trunk/source/examples/cocoa/easygui/action-targets.lisp @ 11899

Last change on this file since 11899 was 7325, checked in by gz, 13 years ago

First checking of easygui library

File size: 581 bytes
Line 
1(in-package :easygui)
2
3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4;;; action/targets
5
6(defclass generic-easygui-target (ns:ns-object)
7     ((handler :initarg :handler :reader target-handler))
8  (:metaclass ns:+ns-object))
9
10(objc:defmethod (#/activateAction :void) ((self generic-easygui-target))
11  (funcall (target-handler self)))
12
13(defmethod (setf action) (handler (view view))
14  (let ((target (make-instance 'generic-easygui-target
15                   :handler handler)))
16    (#/setTarget: (cocoa-ref view) target)
17    (#/setAction: (cocoa-ref view) (@selector #/activateAction))))
Note: See TracBrowser for help on using the repository browser.