cocoa: avoid another 10.6-only method
Closes PR 11440 original commit: 584287483b0aae37174cfa8cc65589203bff2cdd
This commit is contained in:
parent
4737e58099
commit
277c10793a
|
@ -74,7 +74,9 @@
|
||||||
;; all other eventspaces and threads. It would be nice to improve
|
;; all other eventspaces and threads. It would be nice to improve
|
||||||
;; on this, but it's good enough.
|
;; on this, but it's good enough.
|
||||||
(atomically
|
(atomically
|
||||||
(let ([front (get-front)])
|
(let ([front (get-front)]
|
||||||
|
[parent (and (version-10.6-or-later?)
|
||||||
|
parent)])
|
||||||
(when parent
|
(when parent
|
||||||
(tellv ns beginSheetModalForWindow: (send parent get-cocoa-window)
|
(tellv ns beginSheetModalForWindow: (send parent get-cocoa-window)
|
||||||
completionHandler: #f))
|
completionHandler: #f))
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
(create-menu "menu")
|
(create-menu "menu")
|
||||||
(let ([b (box #f)])
|
(let ([b (box #f)])
|
||||||
(set! popup-box b)
|
(set! popup-box b)
|
||||||
(if #t ;; use the 10.5 code, for now
|
(if (not (version-10.6-or-later?))
|
||||||
;; For 10.5 and earlier:
|
;; For 10.5 and earlier:
|
||||||
(let ([p (tell #:type _NSPoint v
|
(let ([p (tell #:type _NSPoint v
|
||||||
convertPoint: #:type _NSPoint (make-NSPoint x y)
|
convertPoint: #:type _NSPoint (make-NSPoint x y)
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
clean-menu-label
|
clean-menu-label
|
||||||
->wxb
|
->wxb
|
||||||
->wx
|
->wx
|
||||||
old-cocoa?)
|
old-cocoa?
|
||||||
|
version-10.6-or-later?)
|
||||||
define-mz)
|
define-mz)
|
||||||
|
|
||||||
(define cocoa-lib (ffi-lib (format "/System/Library/Frameworks/Cocoa.framework/Cocoa")))
|
(define cocoa-lib (ffi-lib (format "/System/Library/Frameworks/Cocoa.framework/Cocoa")))
|
||||||
|
@ -79,6 +80,10 @@
|
||||||
(and wxb
|
(and wxb
|
||||||
(weak-box-value wxb)))
|
(weak-box-value wxb)))
|
||||||
|
|
||||||
;; FIXME: need a better test:
|
(define-appkit NSAppKitVersionNumber _double)
|
||||||
(define old-cocoa? (equal? (path->string (system-library-subpath #f))
|
|
||||||
"ppc-macosx"))
|
(define old-cocoa?
|
||||||
|
; earlier than 10.5?
|
||||||
|
(NSAppKitVersionNumber . < . 949))
|
||||||
|
(define (version-10.6-or-later?)
|
||||||
|
(NSAppKitVersionNumber . >= . 1038))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user