diff --git a/ChangeLog b/ChangeLog index cd67df048..42e0de968 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-06-25 00:26 Gregory John Casamento + + * Source/GSNibCompatibility.m: in -[NSIBObjectData + instantiateWithOwner:topLevelObjects:] properly initialize + the NSWindowTemplate and fill in the topLevelObjects array. + 2006-06-20 20:58 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added diff --git a/Source/GSNibCompatibility.m b/Source/GSNibCompatibility.m index 307a02d97..5e57e32d4 100644 --- a/Source/GSNibCompatibility.m +++ b/Source/GSNibCompatibility.m @@ -956,9 +956,10 @@ static BOOL _isInInterfaceBuilder = NO; - (void) nibInstantiateWithOwner: (id)owner topLevelObjects: (NSMutableArray *)topLevelObjects { NSEnumerator *en = [_connections objectEnumerator]; + NSArray *objs = NSAllMapTableKeys([self names]); id obj = nil; id menu = nil; - + // replace the owner with the actual instance provided. [_root setObject: owner]; @@ -972,13 +973,37 @@ static BOOL _isInInterfaceBuilder = NO; } } + // instantiate all windows and fill in the top level array. + en = [objs objectEnumerator]; + while((obj = [en nextObject]) != nil) + { + if([obj isKindOfClass: [NSWindowTemplate class]]) + { + if([obj realObject] == nil) + { + id o = [self instantiateObject: obj]; + [topLevelObjects addObject: o]; + } + } + else + { + id v = NSMapGet(_objects, obj); + if(v == nil || v == owner) + { + [topLevelObjects addObject: obj]; + } + } + } + + // bring visible windows to front... en = [_visibleWindows objectEnumerator]; while((obj = [en nextObject]) != nil) { - id w = [self instantiateObject: obj]; + id w = [obj realObject]; [w orderFront: self]; } + // add the menu... menu = [self objectForName: @"MainMenu"]; if(menu != nil) {