Changeset 5541


Ignore:
Timestamp:
Nov 9, 2006, 2:43:29 PM (18 years ago)
Author:
Gary Byers
Message:

Change the quit protocol.

Location:
trunk/ccl/examples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/cocoa-window.lisp

    r2353 r5541  
    115115              :wait-until-done t)))))
    116116
    117 #+apple-objc
    118 (define-objc-method ("_shouldTerminate" lisp-application)
    119   (:<BOOL>)
    120   (with-slots (termp) self
    121       (setq termp (objc-message-send-super (super) "_shouldTerminate" :<BOOL>))))
    122 
    123 (define-objc-method ((:<BOOL> termp) lisp-application)
    124   (with-slots (termp) self
    125       termp))
     117
     118
    126119
    127120(defloadvar *default-ns-application-proxy-class-name*
     
    186179        (send (the ns-application self) :stop (%null-ptr))))))
    187180
    188 (define-objc-method ((:void :terminate sender)
    189                      lisp-application)
    190   (declare (ignore sender))
    191   (quit))
     181
    192182
    193183(define-objc-method ((:void :show-preferences sender) lisp-application)
     
    207197
    208198
    209 #+apple-objc
    210 (defmethod process-verify-quit ((process appkit-process))
    211   (let* ((app *NSApp*))
    212     (or
    213      (null app)
    214      (not (send app 'is-running))
    215      (eql (pref app :<NSA>pplication._app<F>lags._app<D>ying) #$YES)
    216      (eql (pref app
    217                 :<NSA>pplication._app<F>lags._dont<S>end<S>hould<T>erminate)
    218           #$YES)
    219      (progn
    220        (send
    221         app
    222         :perform-selector-on-main-thread (@selector "_shouldTerminate")
    223         :with-object (%null-ptr)
    224         :wait-until-done t)
    225        (send app 'termp)))))
    226 
    227 #+apple-objc
     199
     200
    228201(defmethod process-exit-application ((process appkit-process) thunk)
    229202  (when (eq process *initial-process*)
    230     (prepare-to-quit)
    231203    (%set-toplevel thunk)
    232     (send (the lisp-application *NSApp*) 'shutdown)
     204    (send (the lisp-application *NSApp*) :terminate (%null-ptr))
    233205    ))
    234206
  • trunk/ccl/examples/cocoa.lisp

    r2021 r5541  
    3030  (declare (ignore notification))
    3131  (initialize-user-interface))
     32
     33(define-objc-method ((:void :application-will-terminate (:id notification))
     34                     lisp-application-delegate)
     35  (declare (ignore notification))
     36  ;; UI has decided to quit; terminate other lisp threads.
     37  (prepare-to-quit))
    3238
    3339(define-objc-method ((:void :new-listener sender) lisp-application-delegate)
Note: See TracChangeset for help on using the changeset viewer.