Index: Headers/AppKit/NSSavePanel.h =================================================================== --- Headers/AppKit/NSSavePanel.h (revision 36733) +++ Headers/AppKit/NSSavePanel.h (working copy) @@ -34,6 +34,7 @@ #ifndef _GNUstep_H_NSSavePanel #define _GNUstep_H_NSSavePanel #import +#import #import @@ -206,6 +207,12 @@ contextInfo: (void *)contextInfo; #endif +#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) +DEFINE_BLOCK_TYPE(GSSavePanelCompletionHandler, void, NSInteger); +- (void) beginSheetModalForWindow:(NSWindow *)window + completionHandler:(GSSavePanelCompletionHandler)handler; +#endif + /* * Reading Save Information */ Index: Source/NSSavePanel.m =================================================================== --- Source/NSSavePanel.m (revision 36733) +++ Source/NSSavePanel.m (working copy) @@ -1110,6 +1110,13 @@ return [self runModalForDirectory: [self directory] file: [self filename]]; } +- (void) beginSheetModalForWindow:(NSWindow *)window + completionHandler:(GSSavePanelCompletionHandler)handler +{ + NSInteger result = [self runModal]; + CALL_BLOCK(handler, result); +} + /**

Initializes the panel to the directory specified by path and, optionally, the file specified by filename, then displays it and begins its modal event loop; path and filename can be empty