Use NSNibOwner instead of @"NSOwner". Remove the hard coded "gorm"

extension. Try to use higher level NIB loading methods where possible.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30077 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2010-03-30 07:54:04 +00:00
parent 4b8af18a65
commit c5e1f2e6a2
8 changed files with 102 additions and 98 deletions

View file

@ -37,6 +37,7 @@
#import <Foundation/NSValue.h>
#import "AppKit/NSApplication.h"
#import "AppKit/NSForm.h"
#import "AppKit/NSNib.h"
#import "AppKit/NSNibLoading.h"
#import "AppKit/NSPrinter.h"
#import "AppKit/NSPrintPanel.h"
@ -138,15 +139,16 @@ static NSPrintPanel *shared_instance;
if (self == nil)
return nil;
panel = [GSGuiBundle() pathForResource: GSPANELNAME ofType: @"gorm"
inDirectory: nil];
// self will come from a bundle, to get the panel from the GUI library
// we have to select that bundle explicitly
panel = [GSGuiBundle() pathForNibResource: GSPANELNAME];
if (panel == nil)
{
NSRunAlertPanel(@"Error", @"Could not find print panel resource",
@"OK", NULL, NULL);
return nil;
}
table = [NSDictionary dictionaryWithObject: self forKey: @"NSOwner"];
table = [NSDictionary dictionaryWithObject: self forKey: NSNibOwner];
if ([NSBundle loadNibFile: panel
externalNameTable: table
withZone: [self zone]] == NO)