From 46fac3892bcb9842a7ae8a3354df2f97771549e9 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 20 Nov 2010 15:37:02 -0700 Subject: [PATCH] cocoa: avoid another 10.6-only method Closes PR 11442 original commit: bf9b913f33adaeaec494739a4c1a68a727eb939f --- collects/mred/private/wx/cocoa/filedialog.rkt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/collects/mred/private/wx/cocoa/filedialog.rkt b/collects/mred/private/wx/cocoa/filedialog.rkt index 7ffc630d..419bc4eb 100644 --- a/collects/mred/private/wx/cocoa/filedialog.rkt +++ b/collects/mred/private/wx/cocoa/filedialog.rkt @@ -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))))