Re: addSubview \ replaceSubview won't support embedded controls
Re: addSubview \ replaceSubview won't support embedded controls
- Subject: Re: addSubview \ replaceSubview won't support embedded controls
- From: Graham Wihlidal <email@hidden>
- Date: Thu, 2 May 2002 22:59:18 -0600
I'm not exactly sure of the language you're using to describe this.
When you say "put the data browser on top of the image view", are you
doing this in code (i.e. calling addSubview: ta add the browser as a
subview of the image view) or in Interface Builder (dragging the
browser on top of the image view). If you're doing this in IB, then
it's not working because when you drag the browser on top of the image
view, it doesn't become a subview of the image view, since the image
view does not support dragging subviews into it in IB. NSViews are not
meant to be overlapped and the front to back ordering of them is not
necessarily respected when drawing, so your browser might be drawing
behind the image view, even though it appears on top in IB. If you add
the browser in code, though, there's no reason this shouldn't work.
Sorry, meant to say in IB. I was thinking the views worked like
PowerPlant :)
That being said, there are two methods that are typically used for
swappable views:
1. Create an NSBox with no title and no border and set its content view
to swap views in and out. This used to be the best way to do it until
option 2 came around.
2. Create an NSTabView and click the "tabless" button in the
inspector. You can then create each of your views as a tab view item
of the tab view and switch between them by simply setting the
appropriate tab view item. Of course you could also dump the pop-up
menu altogether and just use a tabbed view, but this might not be
appropriate for your app, especially if there are lots of choices that
would make too many tabs be unwieldy.
I thought of a tabless NSTabView, but I have about 13 "swaps" needed,
so 13 top tabs (even small) won't fit neatly in a small window :)
(697x447)
Thanks,
Graham
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.