• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Loading a different interface
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading a different interface


  • Subject: Re: Loading a different interface
  • From: Chris Hanson <email@hidden>
  • Date: Sat, 05 Jul 2008 13:53:17 -0700


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 (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Loading a different interface
      • From: John Joyce <email@hidden>
References: 
 >Loading a different interface (From: John Joyce <email@hidden>)

  • Prev by Date: Re: IB3 and custom controls: problem with actions
  • Next by Date: Bit maps from raw camera files
  • Previous by thread: Loading a different interface
  • Next by thread: Re: Loading a different interface
  • Index(es):
    • Date
    • Thread