diff --git a/AppKit/AppKit.j b/AppKit/AppKit.j index fdb8827a3..ae671b2c5 100644 --- a/AppKit/AppKit.j +++ b/AppKit/AppKit.j @@ -25,6 +25,7 @@ @import "CPAnimation.j" @import "CPApplication.j" @import "CPButton.j" +@import "CPButtonBar.j" @import "CPClipView.j" @import "CPCollectionView.j" @import "CPColor.j" diff --git a/AppKit/Cib/CPCib.j b/AppKit/Cib/CPCib.j index 8d2174822..995bcac14 100644 --- a/AppKit/Cib/CPCib.j +++ b/AppKit/Cib/CPCib.j @@ -90,6 +90,7 @@ var CPCibObjectDataKey = @"CPCibObjectDataKey"; [objectData instantiateWithOwner:owner topLevelObjects:topLevelObjects] [objectData establishConnectionsWithOwner:owner topLevelObjects:topLevelObjects]; + [objectData awakeWithOwner:owner topLevelObjects:topLevelObjects]; var menu; diff --git a/AppKit/Cib/_CPCibObjectData.j b/AppKit/Cib/_CPCibObjectData.j index 55c7baea7..2c3dfb2b6 100644 --- a/AppKit/Cib/_CPCibObjectData.j +++ b/AppKit/Cib/_CPCibObjectData.j @@ -223,4 +223,24 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey } } +- (void)awakeWithOwner:(id)anOwner topLevelObjects:(CPMutableArray)topLevelObjects +{ + var count = [_objectsKeys count]; + + while (count--) + { + var object = _objectsKeys[count], + instantiatedObject = _replacementObjects[[object hash]]; + + if (instantiatedObject) + object = instantiatedObject; + + if (object !== _fileOwner && [object respondsToSelector:@selector(awakeFromCib)]) + [object awakeFromCib]; + } + + if ([anOwner respondsToSelector:@selector(awakeFromCib)]) + [anOwner awakeFromCib]; +} + @end