A method identified as deprecated has been superseded and may become unsupported in the future.
This method has been deprecated. (Deprecated in Mac OS X v10.3. There is no replacement.)
- (IBAction)selectText:(id)sender
NSSavePanel.h
Presents a Save panel as a sheet with a specified path and, optionally, a specified file in that path. (Deprecated in Mac OS X v10.6. Use beginSheetModalForWindow:completionHandler:
instead.)
- (void)beginSheetForDirectory:(NSString *)path file:(NSString *)name modalForWindow:(NSWindow *)docWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo
Directory whose files the panel displays. When nil
, the directory is the same directory used in the previous invocation of the panel; this is probably the best choice for most situations.
Specifies a particular file in path that is selected when the Save panel is presented to a user. When nil
, no file is initially selected.
If not nil
, the Save panel slides down as a sheet running as a document modal window in docWindow. If nil
, the behavior defaults to a standalone modal window.
This is not the same as a delegate assigned to the panel. This delegate is temporary and the relationship only lasts until the panel is dismissed. The NSSavePanel
object does not retain the modal delegate.
Message sent to modalDelegate after the modal session has ended, but before dismissing the Save panel. didEndSelector may dismiss the Save panel itself; otherwise, it is dismissed on return from the method. The corresponding method should have the following signature:
- (void)savePanelDidEnd:(NSSavePanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo; |
The value passed as returnCode is either NSCancelButton
or NSOKButton
.
Context information passed to modalDelegate in the didEndSelector message.
NSSavePanel.h
Returns the absolute pathname of the directory currently shown in the panel. (Deprecated in Mac OS X v10.6. Use directoryURL
instead.)
- (NSString *)directory
The absolute pathname of the directory currently shown in the panel.
NSSavePanel.h
Returns the absolute pathname of the file currently shown in the panel. (Deprecated in Mac OS X v10.6. Use URL
instead.)
- (NSString *)filename
The absolute pathname of the file.
NSSavePanel.h
Returns the required file type (if any). (Deprecated in Mac OS X v10.6. Use allowedFileTypes
instead.)
- (NSString *)requiredFileType
The required file type (if any).
A file specified in the Save panel is saved with the designated filename and this file type as an extension. Examples of common file types are “rtf”, “tiff”, and “ps”. File type strings encoding HFS file types are not valid values for this attribute. An nil
return value indicates that the user can save to any ASCII file.
This method is equivalent to calling allowedFileTypes
and returning the first element of the list of allowed types, or nil
if there are none.
NSSavePanel.h
Initializes the panel to the directory and file specified, if any, then displays it and begins its modal event loop. (Deprecated in Mac OS X v10.6. Use runModal
instead.)
- (NSInteger)runModalForDirectory:(NSString *)path file:(NSString *)filename
Directory whose files the panel displays. When nil
, the directory is the same directory used in the previous invocation of the panel; this is probably the best choice for most situations.
Specifies a particular file in path that is selected when the Save panel is presented to a user. When nil
, no file is initially selected.
NSFileHandlingPanelOKButton
(if the user clicks the OK button) or NSFileHandlingPanelCancelButton
(if the user clicks the Cancel button).
This method invokes NSApplication
’s runModalForWindow:
method with self
as the argument.
– runModal
– runModalForWindow:
(NSApplication
)NSSavePanel.h
Sets the current pathname in the panel’s browser. (Deprecated in Mac OS X v10.6. Use setDirectoryURL:
instead.)
- (void)setDirectory:(NSString *)path
String to set as the panel’s current pathname.
The path argument must be an absolute pathname.
NSSavePanel.h
Specifies the type, an extension to be appended to any selected files that don’t already have that extension; “nib” and “rtf” are examples. (Deprecated in Mac OS X v10.6. Use setAllowedFileTypes:
instead.)
- (void)setRequiredFileType:(NSString *)type
String to set as the extension to be appended to any selected files that don’t already have that extension.
The argument type should not include the period that begins the extension. Pass nil
to indicate any type. File type strings encoding HFS file types are not valid values for this attribute. You need to invoke this method each time the Save panel is used for another file type within the application.
This method is equivalent to calling setAllowedFileTypes:
with an array containing only type (unless type is nil, and then it’s equivalent to calling setAllowedFileTypes:
with nil
).
NSSavePanel.h
Controls the ordering of files presented by the NSSavePanel
object specified. (Deprecated in Mac OS X v10.6. There is no replacement.)
- (NSComparisonResult)panel:(id)sender compareFilename:(NSString *)fileName1 with:(NSString *)fileName2 caseSensitive:(BOOL)flag
Panel requesting the ordering.
String representing the first filename to order.
String representing the second filename to order.
If YES
, the ordering is case-sensitive; if NO
, it is not.
One of the following:
NSOrderedAscending
if fileName1 should precede fileName2
NSOrderedSame
if the two names are equivalent
NSOrderedDescending
if fileName2 should precede fileName1
Don’t reorder filenames in the Save panel without good reason, because it may confuse the user to have files in one Save panel or Open panel ordered differently than those in other such panels or in the Finder. The default behavior of Save and Open panels is to order files as they appear in the Finder. Note also that by implementing this method you will reduce the operating performance of the panel.
NSSavePanel.h
Tells the delegate that the user has changed the selected directory in the NSSavePanel
object specified. (Deprecated in Mac OS X v10.6. Use panel:didChangeToDirectoryURL:
(NSOpenSavePanelDelegate
) instead.)
- (void)panel:(id)sender directoryDidChange:(NSString *)path
Panel whose directory has changed.
String representing the new directory’s path.
– panel:didChangeToDirectoryURL:
(NSOpenSavePanelDelegate
)NSSavePanel.h
Gives the delegate the opportunity to validate selected items. (Deprecated in Mac OS X v10.6. Use panel:validateURL:error:
(NSOpenSavePanelDelegate
) instead. If both methods are implemented, the URL version will be called.)
- (BOOL)panel:(id)sender isValidFilename:(NSString *)filename
Panel requesting filename validation.
String representing the filename to validate.
YES
if the filename is valid, or NO
if the save panel should stay in its modal loop and wait for the user to type in or select a different filename or names.
The NSSavePanel
object sender sends this message just before the end of a modal session for each filename displayed or selected (including filenames in multiple selections). If the delegate refuses a filename in a multiple selection, none of the filenames in the selection is accepted.
– panel:validateURL:error:
(NSOpenSavePanelDelegate
)NSSavePanel.h
Gives the delegate the opportunity to filter items that it doesn’t want the user to choose. (Deprecated in Mac OS X v10.6. Use panel:shouldEnableURL:
(NSOpenSavePanelDelegate
).)
- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename
Panel that is querying whether it should show a certain file.
String representing the name of the file to be loaded in the browser.
YES
if filename should be selectable, and NO
if the save panel should disable the file or directory.
The NSSavePanel
object sender sends this message to the panel’s delegate for each file or directory (filename) it is about to load in the browser.
– panel:shouldEnableURL:
(NSOpenSavePanelDelegate
).NSSavePanel.h
Last updated: 2009-02-19