Hi, Trygve,

With regard to your code duplication, I would use a common NSWindowController superclass, with a subclass for your main window and a subclass for your aux window. Then you can just use the right nib name in each of them, but leave the rest of the code identical.

Cheers,
        Andrew

On Jun 3, 2008, at 2:21 PM, Trygve Inda wrote:

Hi All,

Sorry for the vague subject title... Let me explain.

I have one window per attached screen so at least one, but perhaps 3 (for example). There is always one "main" window and the others are considered
"aux windows".

The Main window has 4 groups of controls (A, B, C, D).
The Aux windows have only group A.

I would like to have one controller object handle group A regardless of
being main/aux.

Currently I have 6 methods in "mainWindowController" which are identical to 6 methods in "auxWindowController". auxWindowController has an additional
method or two used to create and center the window from auxWindowNib

It'd be nice to not have this duplication.

The main window and aux window use different Nibs so each nib has a
"somePopupMenu" and each controller has an IBOutlet... MyPopupMenu

Etc.

Since the IBOutlets in Main point to a different Nib than the IBOutlets in Aux (even though they are functionally identical) is there a good, clean way
to manage this?

Or is it better to keep them separate and just have 6 methods that are 99% the same in different objects. (Basically the Aux controller is a subset of
Main Controller, but is not really a child).

Thanks,

Trygve


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/andrew.merenbach%40ucla.edu

This email sent to [EMAIL PROTECTED]

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to