beginForDirectory:file:types:modelessDelegate:didEndSelector:contextInfo:
Presents a modeless Open panel.
Declaration
- (void) beginForDirectory:(NSString *) path file:(NSString *) name types:(NSArray *) fileTypes modelessDelegate:(id) delegate didEndSelector:(SEL) didEndSelector contextInfo:(void *) contextInfo;Parameters
- path:
The 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. - name:
Specifies a particular file in
absoluteDirectoryPaththat is selected when the Open panel is presented to the user. Whennil, no file is initially selected. - fileTypes:
An array of file extensions and/or HFS file types. Specifies the files the panel allows the user to select.
nilmakes all files inabsoluteDirectoryPathselectable by the user. An array of types passed in here will override one set using Allowedfiletypes. - delegate:
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.
- didEndSelector:
The message sent to
modelessDelegateafter the panel’s session has ended, but before dismissing the Open panel.didEndSelectormay dismiss the Open panel itself; otherwise, it will be dismissed on return from the method. The corresponding method should have the following signature:- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfoThe value passed as
returnCodewill be eitherNSCancelButtonorNSOKButton. - contextInfo:
Any context information passed to
modelessDelegatein thedidEndSelectormessage.
Discussion
Similar to beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:, but allows for modeless operation of the panel.