Skip navigation.
 
mlRe: NSView not resizing when parent view resizes
FROM : Michael Becker
DATE : Thu Dec 09 11:52:10 2004

Am 08.12.2004 um 19:02 schrieb John C. Randolph:
> I would just send it a "setAutoresizingMask:(NSViewWidthSizable |
> NSViewHeightSizable)" message.


Doesn't work either. I've set up a sample app which has a "container"
view  (NSBox) and a "child" view (NSView). Actually, I overrode NSView
to paint the view in blue so I could see whether it resizes. Here is
the complete code of the project:

In AppController:

- (void)awakeFromNib {
   [ view setAutoresizingMask:(NSViewHeightSizable | NSViewWidthSizable)];
   [ container addSubview:view];
}

In the NSView subclass:

- (void)drawRect:(NSRect)rect {
   [[NSColor blueColor] set];
   NSRectFill([self frame]);
   [super drawRect:rect];
}

In IB, *every*thing is set to be resizable (NSViewHeightSizable |
NSViewWithSizable). But when I run the application, the subview (in
blue) does not resize. It just sticks to the bottom left corner of the
NSBox.

Is this a bug or am I missing a simple point?

Kind regards,
Michael

Related mailsAuthorDate
mlNSView not resizing when parent view resizes Michael Becker Dec 7, 03:06
mlRe: NSView not resizing when parent view resizes Michael Becker Dec 7, 17:58
mlRe: NSView not resizing when parent view resizes Ricky Sharp Dec 7, 18:30
mlRe: NSView not resizing when parent view resizes Michael Becker Dec 8, 11:24
mlRe: NSView not resizing when parent view resizes John C. Randolph Dec 8, 19:02
mlRe: NSView not resizing when parent view resizes Michael Becker Dec 9, 11:52
mlRe: NSView not resizing when parent view resizes Louis C. Sacha Dec 9, 14:26
ml[SOLVED] Re: NSView not resizing when parent view resizes Michael Becker Dec 9, 15:14