Re: Best way to Change Window
Re: Best way to Change Window
- Subject: Re: Best way to Change Window
- From: Iceberg-Dev <email@hidden>
- Date: Sun, 23 Nov 2008 23:41:41 +0100
On Nov 23, 2008, at 9:44 PM, Gordon Apple wrote:
What is the best way to change to a different window? I have a
main
window nib with a lot of controllers in it. Currently the main
view is in a
scrolling window. I want to live-switch between that and a borderless
(optionally full screen) window or a resizable (non-scrolling) window.
I'm sure I could do this by duplicating or triplicating the nib,
changing what is necessary, closing the window, change out the window
controller in my document, open the new window. However, I don't
like the
duplicity of this approach and the need to synchronize future
changes in
similar nibs. Is there a better way?
NSWindowController has "setWindow", but it also says: "This method
releases the old window and any associated top-level objects in its
nib file
and assumes ownership of the new window. You should generally
create a new
window controller for a new window and release the old window
controller
instead of using this method." What are "associated top-level
objects"? I
don't want anything else to go away, although I would have to code
a few
wiring changes.
When you needed to change between a brushed metal window and an Aqua
window, a solution was to keep the content view of the current
window, delete the window and create a new one with the appropriate
theme and then replace the content view.
In your case, it might be interesting to wonder if you want the
control inside the window to look the same as non full-screen. If you
take a look at iPhoto for instance, the look of the controls differs
between fullscreen and standard mode. If you want the controls to
look different, then maybe another nib is a solution.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden