From a0f78cd62f89c4695be17db417f47b7b7c809cc3 Mon Sep 17 00:00:00 2001 From: gcasa Date: Sat, 24 Nov 2007 17:39:44 +0000 Subject: [PATCH] Moved awakeFromNib to later in the nib loading process. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25605 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/GSNibCompatibility.m | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 953e99ce7..ddad2bcdc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-24 12:38-EST Gregory John Casamento + + * Source/GSNibCompatibility.m: Call awakeFromNib later in the nib + unarchiving process. + 2007-11-22 Fred Kiefer * Source/NSNibBindingConnector.m: Completed implementation. diff --git a/Source/GSNibCompatibility.m b/Source/GSNibCompatibility.m index 85e523235..fa8cd7b32 100644 --- a/Source/GSNibCompatibility.m +++ b/Source/GSNibCompatibility.m @@ -1050,11 +1050,6 @@ static BOOL _isInInterfaceBuilder = NO; if ([obj respondsToSelector: @selector(nibInstantiate)]) { newObject = [obj nibInstantiate]; - if ([newObject respondsToSelector: @selector(awakeFromNib)]) - { - // awaken the object. - [newObject awakeFromNib]; - } } return newObject; } @@ -1084,16 +1079,18 @@ static BOOL _isInInterfaceBuilder = NO; } } - // instantiate all windows and fill in the top level array. + // iterate over all objects instantiate windows, awaken objects and fill + // in top level array. en = [objs objectEnumerator]; while ((obj = [en nextObject]) != nil) { + // instantiate all windows and fill in the top level array. if ([obj isKindOfClass: [NSWindowTemplate class]]) { if ([obj realObject] == nil) { - id o = [self instantiateObject: obj]; - [topLevelObjects addObject: o]; + obj = [self instantiateObject: obj]; + [topLevelObjects addObject: obj]; } } else @@ -1104,6 +1101,12 @@ static BOOL _isInInterfaceBuilder = NO; [topLevelObjects addObject: obj]; } } + + // awaken the object. + if ([obj respondsToSelector: @selector(awakeFromNib)]) + { + [obj awakeFromNib]; + } } // bring visible windows to front...