Medianno/Medianno/MAAppController.mm
2011-08-15 03:15:07 +02:00

40 lines
966 B
Plaintext

//
// MAAppController.mm
// Medianno
//
// Created by Matthias Neeracher on 8/11/11.
// Copyright 2011 Matthias Neeracher. All rights reserved.
//
#import "MAAppController.h"
@implementation NSApplication (SheetAdditions)
- (void)beginSheet: (NSWindow *)sheet modalForWindow:(NSWindow *)docWindow didEndBlock: (MASheetBlock)block
{
[self beginSheet: sheet
modalForWindow: docWindow
modalDelegate: self
didEndSelector: @selector(my_blockSheetDidEnd:returnCode:contextInfo:)
contextInfo: Block_copy(block)];
}
- (void)my_blockSheetDidEnd: (NSWindow *)sheet returnCode: (NSInteger)returnCode contextInfo: (void *)contextInfo
{
MASheetBlock block = (MASheetBlock)contextInfo;
block(returnCode);
Block_release(block);
}
@end
@implementation MAAppController
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
[[NSDocumentController sharedDocumentController] setAutosavingDelay:30.0];
}
@end