Swapping an NSView between NSWindows
Swapping an NSView between NSWindows
- Subject: Swapping an NSView between NSWindows
- From: Michael Wood <email@hidden>
- Date: Fri, 6 May 2005 15:35:58 -0700
Hi, I have a document-based application with a main NSWindow
(mainWindow). The mainWindow has an NSView (mainView) which was added
using Interface Builder. While the application is running, I
programatically create a new window and set its content view using
setContentView:
[newWindow setContentView:mainView];
This has the desired effect of moving my view to the newWindow,
without any delay. Transfering the view from one window to another in
this way seems to wipe out the view in the original window.
I would like to transfer the view back to the original window from
the newWindow (the same way it was set up in Interface Builder). My
problem is that I can't use "[mainWindow setContentView:mainView]"
because it removes the entire content view from the original window
which contain buttons that need to remain.
Is there any way to swap an NSView between NSWindows by either:
a) programatically sizing and positioning an NSView inside an
NSWindow?
b) reconstructing the NIB and replacing the NSView with my
mainView?
c) referencing my mainView in my newWindow so [newWindow
setContentView:mainView]; doesn't kill the mainView from my mainWindow?
Thanks,
Mike.
_______________________________________________
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