ppc cocoa

original commit: 2cebc60eca44c78a441f89a825dd1eb3d60db7d7
This commit is contained in:
Matthew Flatt 2010-10-23 20:11:12 -06:00
parent 0b65316bdf
commit 31a364e892
2 changed files with 17 additions and 5 deletions

View File

@ -564,10 +564,17 @@
[(scroller val)
(when scroller
(set-scroller-page! scroller val)
(tellv (scroller-cocoa scroller) setKnobProportion:
#:type _CGFloat (max (min 1.0 (/ val
(+ val (exact->inexact (scroller-range scroller)))))
0.0)))]
(let ([proportion
(max (min 1.0 (/ val
(+ val (exact->inexact (scroller-range scroller)))))
0.0)])
(if old-cocoa?
(tellv (scroller-cocoa scroller)
setFloatValue: #:type _float (tell #:type _float (scroller-cocoa scroller)
floatValue)
knobProportion: #:type _CGFloat proportion)
(tellv (scroller-cocoa scroller) setKnobProportion:
#:type _CGFloat proportion))))]
[(scroller)
(if scroller
(scroller-page scroller)

View File

@ -18,7 +18,8 @@
with-autorelease
clean-menu-label
->wxb
->wx)
->wx
old-cocoa?)
(define cocoa-lib (ffi-lib (format "/System/Library/Frameworks/Cocoa.framework/Cocoa")))
(define cf-lib (ffi-lib (format "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation")))
@ -69,3 +70,7 @@
(define (->wx wxb)
(and wxb
(weak-box-value wxb)))
;; FIXME: need a better test:
(define old-cocoa? (equal? (path->string (system-library-subpath #f))
"ppc-macosx"))