Skip navigation.
 
mlRe: How can a view know when its superview changes sizes?
FROM : Shawn Erickson
DATE : Tue Apr 26 23:45:44 2005

On Apr 26, 2005, at 2:36 PM, Sean McBride wrote:

> On 2005-04-26 11:40, Shawn Erickson said:
>

>> Consider NSViewBoundsDidChangeNotification or assuming you are dealing
>> with a subclassing of NSView then as you noted override
>> resizeWithOldSuperviewSize:. You should get this message if the
>> super-view has auto-resizing enabled (see setAutoresizesSubviews:).

>
> After more tests, I do get resizeWithOldSuperviewSize: messages if my
> view has at least one spring set in IB.  Very weird.


Well it makes some sense given that the method that calls it uses those
bits to decide who it should ask to resize (I had assuming you denoted
some axis was resizable). Hard to say how you should solve it without
knowing more about what you are trying to do.

For example you could subclass the containing view and override
resizeSubviewsWithOldSize: among other options.

-Shawn

Related mailsAuthorDate
mlHow can a view know when its superview changes sizes? Sean McBride Apr 26, 20:25
mlRe: How can a view know when its superview changes sizes? John Brownlow Apr 26, 20:37
mlRe: How can a view know when its superview changes sizes? Shawn Erickson Apr 26, 20:40
mlRe: How can a view know when its superview changes sizes? Sean McBride Apr 26, 21:59
mlRe: How can a view know when its superview changes sizes? Sean McBride Apr 26, 23:36
mlRe: How can a view know when its superview changes sizes? Shawn Erickson Apr 26, 23:45