Added NSWindowController and the NSDocument* classes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4868 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Michael Silva 1999-09-11 00:52:04 +00:00
parent 33dbd8054f
commit dd6369058e
12 changed files with 1841 additions and 2 deletions

View file

@ -52,6 +52,7 @@
#include <AppKit/NSGraphicsContext.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSDocumentController.h>
#include <AppKit/NSPopUpButton.h>
#include <AppKit/NSPasteboard.h>
#include <AppKit/NSPanel.h>
@ -217,6 +218,10 @@ NSApplication *NSApp = nil;
{
[delegate application: self openFile: filePath];
}
else
{
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfFile:filePath display:YES];
}
}
else if ((filePath = [defs stringForKey: @"GSTempPath"]) != nil)
{
@ -224,6 +229,10 @@ NSApplication *NSApp = nil;
{
[delegate application: self openTempFile: filePath];
}
else
{
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfFile:filePath display:YES];
}
}
}
@ -1448,6 +1457,9 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
if ([delegate respondsToSelector: @selector(applicationShouldTerminate:)])
shouldTerminate = [delegate applicationShouldTerminate: sender];
else
shouldTerminate = [[NSDocumentController sharedDocumentController] reviewUnsavedDocumentsWithAlertTitle:@"Quit" cancellable:YES];
if (shouldTerminate)
{
app_should_quit = YES;