Changeset 13742


Ignore:
Timestamp:
May 29, 2010, 1:00:19 AM (9 years ago)
Author:
gz
Message:

Use execute-in-gui/queue-for-gui. Move extended-demo example to contribs

Location:
trunk/source
Files:
1 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/source/examples/cocoa/easygui/easygui.asd

    r11899 r13742  
    3535                        ((:file "tiny")
    3636                         (:file "currency-converter")
    37                          (:file "view-hierarchy")
    38                          (:file "extended-demo")))))
     37                         (:file "view-hierarchy")))))
  • trunk/source/examples/cocoa/easygui/new-cocoa-bindings.lisp

    r11899 r13742  
    139139;;; Running things on the main thread:
    140140
    141 (defclass cocoa-thunk (ns:ns-object)
    142      ((thunk :accessor thunk-of))
    143   (:metaclass ns:+ns-object))
    144 
    145 (objc:defmethod (#/run :void) ((self cocoa-thunk))
    146   (funcall (thunk-of self)))
    147 
    148141(defun run-on-main-thread (waitp thunk)
    149   (let ((thunk* (make-instance 'cocoa-thunk)))
    150     (setf (thunk-of thunk*) thunk)
    151     (#/performSelectorOnMainThread:withObject:waitUntilDone:
    152      thunk*
    153      (@selector #/run)
    154      +null-ptr+
    155      (not (not waitp)))))
     142  (if waitp
     143    (execute-in-gui thunk)
     144    (queue-for-gui thunk)))
    156145
    157146(defmacro running-on-main-thread ((&key (waitp t)) &body body)
  • trunk/source/examples/cocoa/easygui/package.lisp

    r12719 r13742  
    22  (:use :cl)
    33  (:import-from :ccl with-autorelease-pool @selector lisp-string-from-nsstring +null-ptr+)
     4  (:import-from :gui execute-in-gui queue-for-gui)
    45  (:export #:point #:ns-point-from-point #:range #:rectangle #:window
    56           #:point-x #:point-y #:rectangle-x #:rectangle-y #:rectangle-width
     
    2728           #:double-value-of
    2829           #:view-named #:view-nick-name
    29            #:view-size view-position
     30           #:view-size #:view-position
    3031           #:view-mouse-position
    3132           #:view-font #:with-focused-view
     
    4748           #:dcc
    4849           #:perform-close #:window-may-close
     50
     51           #:execute-in-gui
     52           #:queue-for-gui
    4953           ;; variables
    5054           #:*screen-flipped*
Note: See TracChangeset for help on using the changeset viewer.