Re: changing entire content view of an NSWindow
Re: changing entire content view of an NSWindow
- Subject: Re: changing entire content view of an NSWindow
- From: Enrique Zamudio <email@hidden>
- Date: Tue, 15 May 2001 13:53:20 -0500
- Organization: Nasoft
>
Date: Mon, 14 May 2001 18:45:06 -0700
>
From: Andreas Wolf <email@hidden>
>
To: email@hidden
>
Subject: changing entire content view of an NSWindow
>
>
Hi!
>
>
I have an collection of self written cocoa applications each with its
>
own window that I would like to be able to run from within a single
>
application. My idea was to have something like a menu with the names
>
of all these applications I wrote. Upon selection of one particular app
>
the new app's window should take over the contents of the selected
>
app's window. I know I can launch each app with a separate window but
>
I'd rather like to have just one window for the collection and it should
>
change it's contents according to the users selected app.
>
(That probably sounds very superfluous, but it makes sense for what I
>
really want to do).
>
>
Now, I put up with to the fact that I'll have to recompile each single
>
app as a bundle and
>
load it from the new app as a bundle upon user request, because an app
>
(no big deal).
>
My question is: is it possible to grab the bundled component's window
>
content view and set it to the new apps content view (or even in a
>
subView) ?
>
Calling
>
-(id) contentView and
>
-(void) setContentView:(NSView*) aView
>
from the NSWindow class doesn't seem to be enough for that task.
>
perhaps you have to send the -display message to the window (or the content view)
after the swap.
If that doesn't work, try putting an NSBox without borders or titles on your main
window, make it as large as the window's contentView, and then set its
contentView to whatever view you want the user to see. That should work (I know
because I've done it before)
eZL