diff --git a/AppKit/CPBox.j b/AppKit/CPBox.j index b87303569..40522d306 100644 --- a/AppKit/CPBox.j +++ b/AppKit/CPBox.j @@ -67,6 +67,8 @@ CPBelowBottom = 6; CPString _title @accessors(getter=title); int _titlePosition @accessors(getter=titlePosition); CPTextField _titleView; + + BOOL _cachedAutoresizesSubviews; } + (Class)_binderClassForBinding:(CPString)aBinding @@ -812,6 +814,19 @@ CPBelowBottom = 6; [self setNeedsDisplay:YES]; } +- (void)setAutoresizesSubviews:(BOOL)flag +{ + // CPBox should always resize its subviews, like in Cocoa, whatever is the corresponding flag set. + // We have to keep the flag value as we could have to return it in -autoresizesSubview method. + _cachedAutoresizesSubviews = !!flag; + [super setAutoresizesSubviews:YES]; +} + +- (BOOL)autoresizesSubview +{ + return _cachedAutoresizesSubviews; +} + @end #pragma mark -