Re: Can I "share" a view between nibs?
Re: Can I "share" a view between nibs?
- Subject: Re: Can I "share" a view between nibs?
- From: Shaun Wexler <email@hidden>
- Date: Thu, 3 Jul 2003 18:25:09 -0700
On Thursday, July 3, 2003, at 04:08 PM, Michael Norris wrote:
Apologies for misleading terminology. I didn't actually *mean*
controllers (somehow that word got stuck in my head). I actually meant
"controls", or to be more pedantic, "User Interface Elements". Please
do a grep on my previous message. :o)
What a relief... ;)
I've posted a screenshot here:
http://mnorris.wellington.net.nz/screenshot.jpg
All the elements from the word "score" down I want to be able to
replicate on other nibs, while everything above that I want to be
different in other nibs.
In a new "base" nib, past your existing window/view as a top-level
window object, and create one "options" top-level custom view object in
a separate nib file. Cut all of the "above the score" elements, and
paste them into this custom view. Each nib's File Owner will be your
base controller class. Drag a new custom view into the window,
arranged in place of the union of all the objects you cut. Basically,
these custom views should all have a frame size which encompasses the
"default" MNScoreView and the Messages view frame rects. In your
"base" controller class (ie the nib's owner) you will always load the
base nib file, and call a separate controller method to load the
default "options" nib. When you subclass your controller, override
this method with the name of the custom options nib, if any, or it will
default to super, which just loads the default options nib. Any
new/different controls in your subclasses/nibs will specify outlets for
their unique controls. Simple? This is also easy to implement with a
plug-in & plist architecture, for further flexibility in development,
depending on how many separate options nibs/controllers you need. If
it's less than 5-6, just do it manually.
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
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.