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: Thu, 9 Dec 2004 11:52:10 +0100
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
_______________________________________________
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