mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 04:50:37 +00:00
Rewrite of top level object handling in NIB/Gorm/Xib loading.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30070 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d1c9ba660b
commit
504a5c2064
8 changed files with 55 additions and 84 deletions
|
@ -38,6 +38,7 @@
|
|||
#import <GNUstepBase/GSMime.h>
|
||||
|
||||
#import "AppKit/NSApplication.h"
|
||||
#import "AppKit/NSNib.h"
|
||||
#import "AppKit/NSNibLoading.h"
|
||||
#import "GNUstepGUI/GSModelLoaderFactory.h"
|
||||
#import "GNUstepGUI/GSNibLoading.h"
|
||||
|
@ -576,19 +577,8 @@
|
|||
NSEnumerator *en;
|
||||
id obj;
|
||||
IBObjectContainer *objects;
|
||||
NSMutableArray *topLevelObjects = [context objectForKey: @"NSTopLevelObjects"];
|
||||
id owner = [context objectForKey: @"NSOwner"];
|
||||
|
||||
// get using the alternate names.
|
||||
if (topLevelObjects == nil)
|
||||
{
|
||||
topLevelObjects = [context objectForKey: @"NSNibTopLevelObjects"];
|
||||
}
|
||||
|
||||
if (owner == nil)
|
||||
{
|
||||
owner = [context objectForKey: @"NSNibOwner"];
|
||||
}
|
||||
NSMutableArray *topLevelObjects = [context objectForKey: NSNibTopLevelObjects];
|
||||
//id owner = [context objectForKey: NSNibOwner];
|
||||
|
||||
objects = [data objectForKey: @"IBDocument.Objects"];
|
||||
[objects nibInstantiate];
|
||||
|
@ -602,15 +592,8 @@
|
|||
if ([obj respondsToSelector: @selector(nibInstantiate)])
|
||||
{
|
||||
obj = [obj nibInstantiate];
|
||||
if (topLevelObjects == nil)
|
||||
{
|
||||
// When there is no top level object array, just retain these objects
|
||||
RETAIN(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
[topLevelObjects addObject: obj];
|
||||
}
|
||||
[topLevelObjects addObject: obj];
|
||||
RETAIN(obj);
|
||||
}
|
||||
|
||||
// instantiate all windows and fill in the top level array.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue