How do I place all of my UI elements to be subviews of another view/window?

Apprentice
Posts: 5
Joined: 2009.01
Post: #1
Right now I have a bunch of labels/buttons in the Interface builder - what's the best way to make another "screen" in the IB and convert to it? Should I add these my UI pieces onto a view/window and then create a new view? But the IB gets messy pretty quick. Is there a way to have multiple screens and switch between them?
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #2
You can do it all in IB using an NSTabView. If you want the tabs to be invisible, you can set its style to hidden (or something) and then connect buttons to its actions for next and previous tab. You can probably bind the buttons' enabled state to the tab view too. Or you can tell the tab view to change tab with code.

There are plenty of other ways to achieve the same effect with code, most of which use the addSubview: method of NSView. That would let you have multiple XIB files if you'd prefer to work that way.
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.01
Post: #3
I made a Tab Bar Controller and got "Item1" to load "Game1ViewController.nib" by setting its NIB NAme in Attributes. Back in Game1ViewController.nib, my main view, how do I connect a button to the next/previous tabs? I found "goForward" and "goBack" if I dragged it to First Responder but that didn't seem to do anything.
Do I have to write events for changing the tabs? (Also, how do I have more than 2?)
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  multiple nsopengl subviews problem NelsonMandella 0 2,217 Nov 9, 2009 09:44 PM
Last Post: NelsonMandella
  When to create custom OpenGL view instead of subclass NSOpenGL view Coyote 37 22,326 Oct 20, 2009 08:16 PM
Last Post: Coyote
  Printing OpenGL View in Window skyhawk 3 3,727 Mar 21, 2007 02:05 PM
Last Post: unknown
  Copying from OpenGL window to other window Ingemar 7 4,868 Nov 4, 2006 03:50 AM
Last Post: OneSadCookie
  Problem with overlapping micro-elements whabilly 6 3,621 Jan 3, 2006 01:37 AM
Last Post: OneSadCookie