FROM : Louis C. Sacha
DATE : Thu Dec 09 14:26:29 2004
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
>
DATE : Thu Dec 09 14:26:29 2004
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
>
| Related mails | Author | Date |
|---|---|---|
| Michael Becker | Dec 7, 03:06 | |
| Michael Becker | Dec 7, 17:58 | |
| Ricky Sharp | Dec 7, 18:30 | |
| Michael Becker | Dec 8, 11:24 | |
| John C. Randolph | Dec 8, 19:02 | |
| Michael Becker | Dec 9, 11:52 | |
| Louis C. Sacha | Dec 9, 14:26 | |
| Michael Becker | Dec 9, 15:14 |






Cocoa mail archive

