Re: Windows inside Windows
Re: Windows inside Windows
- Subject: Re: Windows inside Windows
- From: Dustin Mierau <email@hidden>
- Date: Sun, 23 Dec 2001 17:04:49 -0800
Hey,
Hello everyone. I am prepareing to write an app that has multiple
views. Instead of using a tabbed view for each view, i'd like to use a
toolbar that when the the user clicks on a toolbar item the current
view in the window is replaced with the view the user wishes to see.
basicly, i'd like my app to act like the System Preferences app does
except i'd like the toolbar to remain static (at the top of the
window). how can i accomplish this? can i build each view as sepereate
windows in IB, then load them as needed into an NSView that takes up
pretty much all of my main window? if so, how does one load a window
into a view? thanks for all your help.
You shouldn't need an NSTabView at all. In IB, put an NSView in your
main window, connect it to your controller so you can reference it. Now,
make as many NSViews as you need by simply dragging them to your main IB
project window, connect those to your controller as well.
Now, when a toolbar item is pressed, simply size the view you are going
to show with the view that is displayed and swap then swap em. There are
methods in NSView to swap a view with another view, and resize.
This makes your IB project much easier to manage because you have a
separate NSView for each panel.
I hope this is the effect you are going for.
Lates,
-dustin