On Jul 5, 2008, at 8:30 AM, John Joyce wrote:

In my application, I would like to give my users the option to choose various interface styles. I've laid out my interface using a standard NSPanel as well as the HUD version. Both are suitable, but some users will prefer one over the other, of course.
Currently, I have both windows in one NIB.
Is there a way to choose which window is loaded from the NIB?
Is it possible to do this without losing the data in the document? (it is document based) Would it be better/more practical to factor these into two different NIBs?

Yes. Refactor your interface into two nibs, where each nib is owned by an NSWindowController rather than by an NSDocument subclass. Then you can override -[NSDocument makeWindowControllers] in your NSDocument subclass to instantiate whichever NSWindowController is initially appropriate, and when you want to "switch" interface styles you can use -[NSDocument addWindowController:] and -[NSDocument removeWindowController:] to get rid of the old and add the new.

  -- Chris

_______________________________________________

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