Changeset 11897


Ignore:
Timestamp:
Apr 4, 2009, 11:48:52 PM (11 years ago)
Author:
rme
Message:

Add :button-string keyword arg to COCOA-CHOOSE-NEW-FILE-DIALOG.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/file-dialogs.lisp

    r11895 r11897  
    33;;;; MCL-ish file dialogs
    44
    5 (defun %cocoa-choose-file-dialog (directory file-types file)
     5(defun %cocoa-choose-file-dialog (directory file-types file button-string)
    66  (assume-cocoa-thread)
    77  (let* ((open-panel (#/openPanel ns:ns-open-panel))
     
    2020          (#/release s)))
    2121      (#/autorelease types-array))
     22    (when button-string
     23      (#/setPrompt: open-panel (#/autorelease (%make-nsstring button-string))))
    2224    (let ((result (#/runModalForDirectory:file:types: open-panel directory
    2325                                                      file types-array)))
     
    2931             (error "couldn't run the open panel: error code ~d" result))))))
    3032       
    31 (defun cocoa-choose-file-dialog (&key directory file-types file)
     33(defun cocoa-choose-file-dialog (&key directory file-types file button-string)
    3234  (when (and directory (not (directoryp directory)))
    3335    (error "~s doesn't designate a directory." directory))
     
    3840  (when (and file (not (probe-file file)))
    3941    (error "~s doesn't designate a file." file))
    40   (execute-in-gui #'(lambda () (%cocoa-choose-file-dialog directory file-types file))))
     42  (execute-in-gui #'(lambda () (%cocoa-choose-file-dialog directory file-types file button-string))))
    4143
    4244(defun %cocoa-choose-new-file-dialog (directory file-types file)
Note: See TracChangeset for help on using the changeset viewer.