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: "Louis C. Sacha" <email@hidden>
- Date: Thu, 9 Dec 2004 05:26:29 -0800
Hello...
NSBox instances use an instance of NSView as a content view, so you
probably don't want to directly add your custom view as a subview of
the NSBox.
If you want the instance of your NSView custom class to be used as
the content view of the NSBox, use
IBOutlet NSBox *container;
[container setContentView:yourCustomView];
When it is the content view, your custom view will be automatically
resized to fill the box content area whenever necessary.
If you want to place your custom view in the box (but not use it to
fill the box as the content view):
[[container contentView] addSubview:yourCustomView];
In this case, your custom view will be resized (according to whatever
autoresize mask you have set) whenever the content view of the NSBox
is resized.
Hope that helps,
Louis
[ container addSubview:view];
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