cocoa: avoid another 10.6-only method

Closes PR 11442

original commit: bf9b913f33adaeaec494739a4c1a68a727eb939f
This commit is contained in:
Matthew Flatt 2010-11-20 15:37:02 -07:00
parent 277c10793a
commit 46fac3892b

View File

@ -57,11 +57,14 @@
(when message
(tellv ns setMessage: #:type _NSString message))
(when directory
(tellv ns setDirectoryURL: (tell NSURL
fileURLWithPath: #:type _NSString (if (string? directory)
directory
(path->string directory))
isDirectory: #:type _BOOL #t)))
(let ([dir (if (string? directory)
directory
(path->string directory))])
(if (version-10.6-or-later?)
(tellv ns setDirectoryURL: (tell NSURL
fileURLWithPath: #:type _NSString dir
isDirectory: #:type _BOOL #t))
(tellv ns setDirectory: #:type _NSString dir))))
(when filename
(tellv ns setNameFieldStringValue: #:type _NSString (path->string
(file-name-from-path filename))))