Changeset 678
- Timestamp:
- Mar 19, 2004, 11:38:17 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/ccl/examples/cocoa-editor.lisp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/examples/cocoa-editor.lisp
r666 r678 413 413 (hemlock-ext::make-key-event c bits))))) 414 414 415 ;;; Process a key-down NSEvent in a lisp text view by translating it 416 ;;; into a Hemlock key event and passing it into the Hemlock command 417 ;;; interpreter. The underlying buffer becomes Hemlock's current buffer 418 ;;; and the containing pane becomes Hemlock's current window when the 419 ;;; command is processed. Use the frame's command state object. 420 421 (define-objc-method ((:void :key-down event) 422 hemlock-text-view) 415 (defun pass-key-down-event-to-hemlock (self event) 423 416 #+debug 424 417 (#_NSLog #@"Key down event = %@" :address event) … … 440 433 (hi::*echo-area-stream* 441 434 (hemlock-frame-echo-area-stream w)) 442 (hi::*echo-area-window* hi::*current-window*)435 (hi::*echo-area-window* (slot-value w 'echo-area-view )) 443 436 (hi::*echo-area-region* 444 437 (hi::buffer-region hi::*echo-area-buffer*))) 445 438 (hi::interpret-key-event key-event info))))))))) 439 440 ;;; Process a key-down NSEvent in a lisp text view by translating it 441 ;;; into a Hemlock key event and passing it into the Hemlock command 442 ;;; interpreter. The underlying buffer becomes Hemlock's current buffer 443 ;;; and the containing pane becomes Hemlock's current window when the 444 ;;; command is processed. Use the frame's command state object. 445 446 (define-objc-method ((:void :key-down event) 447 hemlock-text-view) 448 (pass-key-down-event-to-hemlock self event)) 446 449 447 450 ;;; Update the underlying buffer's point. Should really set the … … 692 695 693 696 697 (defmethod hi::activate-hemlock-view ((view text-pane)) 698 (let* ((hemlock-frame (send view 'window)) 699 (text-view (text-pane-text-view view))) 700 (send hemlock-frame :make-first-responder text-view))) 701 702 694 703 (defclass echo-area-view (ns:ns-text-view) 695 704 () 696 705 (:metaclass ns:+ns-object)) 706 707 (defmethod hi::activate-hemlock-view ((view echo-area-view)) 708 (let* ((hemlock-frame (send view 'window))) 709 (send hemlock-frame :make-first-responder view))) 697 710 698 711 ;;; The "document" for an echo-area isn't a real NSDocument. … … 704 717 (declare (ignore change))) 705 718 719 (define-objc-method ((:void :key-down event) 720 echo-area-view) 721 (pass-key-down-event-to-hemlock self event)) 706 722 707 723 … … 1221 1237 (send textview :page-up nil))))) 1222 1238 1223 1239 (defun hi::get-key-event (text-view ignore) 1240 (declare (ignore ignore)) 1241 (let* ((event (send (send text-view 'window) 1242 :next-event-matching-mask #$NSKeyDownMask))) 1243 (nsevent-to-key-event event))) 1224 1244 1225 1245 (provide "COCOA-EDITOR")
Note:
See TracChangeset
for help on using the changeset viewer.
