Re: Request for Guidance
Re: Request for Guidance
- Subject: Re: Request for Guidance
- From: Chris Giordano <email@hidden>
- Date: Thu, 5 Sep 2002 10:48:27 -0400
Terry,
I've done something similar using a toolbar to select the views, and
swapping in views to replace the content view of a preferences window.
I store the views in bundles that get loaded dynamically because it gets
used in a number of different situations with different sets of panes so
I wanted to make it as flexible as possible.
To implement the changing, I stored a dictionary keyed on the
identifiers of the panes that included the view that I would swap in.
Then, the toolbar would call a method that would lookup the appropriate
view from teh dictionary (based on the identifier) and replace the
window's content view with that view (after doing some processing of the
previous data, and then doing some processing of new data for the new
view).
It isn't horribly complicated, but it took me a little bit to learn all
of the pieces that I needed to in order to get this working. I'd check
out the OAPreferences content in OmniGroup's OmniAppKit framework,
too -- it does pretty much exactly what you want.
If you'll have a fixed set of fixed views, the tab view will probably be
much easier. I just figured I'd share another way of doing it.
chris
On Thursday, September 5, 2002, at 08:16 AM, Kurt Revis wrote:
On Thursday, September 5, 2002, at 04:45 AM, Terry_Smyth wrote:
The app is basically a configuration utility for viewing and changing
various bits of proprietary data (which is held in files, and accessed
independently by a separate tool). Because the data to be
configured/viewed falls neatly into a number of distinct categories,
it would seem nice to have a UI which is similar to the System
Preferences - ie a row of buttons, each of which swaps in a separate
configuration interface. This seems a logical choice to me, but feel
free to suggest alternatives.
My main question is what is the best way to implement this swapping of
panes? I'm thinking of having a number of overlayed NSViews (custom
view from IB pallette?), only one of which is visible at a time.
Clicking a button hides the current NSView and shows the requested one
(using removeFromSuperview and addSubview), with resizing of the main
window if required. Does this sound like a valid approach? Presumably
hiding an NSView also hides all its subviews?
This will work, but there is an easier way these days. Just use an
NSTabView, with one tab for each "pane", and set it to be tabless in
IB. Your buttons should send a message to some controller object,
which then tells the tab view which tab to display.
--
Kurt Revis
email@hidden
_______________________________________________
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.