Re: NSView not resizing when parent view resizes
Re: NSView not resizing when parent view resizes
- Subject: Re: NSView not resizing when parent view resizes
- From: Michael Becker <email@hidden>
- Date: Wed, 8 Dec 2004 11:24:55 +0100
Am 07.12.2004 um 18:30 schrieb Ricky Sharp:
What is happening? How can I make them resize smoothly according to
their superviews?
I know you mentioned that you've called setAutoresizesSubviews:. Have
you also called setAutoresizingMask: to set up the appropriate
options? Ultimately, all your subviews should be receiving
resizeWithOldSuperviewSize: messages. NSView's default implementation
of resizeWithOldSuperviewSize: is to use the options set up with
setAutoresizingMask:. You can also override
resizeWithOldSuperviewSize if you need something custom.
Hm, doesn't work either. Here is a part of my NSView subclass code:
- (unsigned int)autoresizingMask {
NSLog(@"autoresizingMask");
return (NSViewWidthSizable | NSViewHeightSizable);
}
- (BOOL)autoresizesSubviews {
NSLog(@"autoresizesSubviews");
return YES;
}
- (void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize {
NSLog(@"resizeWithOldSuperviewSize");
[ super resizeWithOldSuperviewSize:oldBoundsSize];
}
Although all the views are set up in IB to be of this custom class,
nothing is ever getting logged. I rephrase: These custom views are set
up as a subview of another custom view object (which overrides
basically only the drawRect: method to make it look fancier). If I
resize the window, the "superview" view resizes nicely but these
embedded views do not. In IB I have all the sizing options set up
correctly, AFAICS.
Cheers,
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden