views:

51

answers:

2

How guys. I'm not top dev in java, but what I`m really not is cocoa top dev :P

I would like to have your assistance to produce a layout with cocoa and IB to work just like the CardLayout in Java.

Do you have some idea of how to do it? Thanks for the attention!

EDIT: CardLayout: A set of panels ("cards") are designed to compose a "deck of cards".It works like a queue of panels, in which only the first "card" is shown on the interface.I can easily interchange between cards if I want so to modify the interface to the user.

I hope I could help you to help me. =)

A: 

Hi, guys. take a look how I've solved my problem. I've created a class in which extends NSView:PersonalNSView.This class adds two new attributes: IBOutlet PersonalNSView previousView; IBOutlet PersonalNSView nextView;

In the Interface Builder: 1.I have a NSpanel that will serve to put these views as content. 2.I instantiate as much PersonalNSViews I want always pointing the new attributes previousView, and nextView.

The FileOwner is a class that extends NSWindowController,MyWindowController, and its window attribute is the NSPanel(1).I also have an extra attribute IBOulet PersonnalNSView currentView that is pointing to the first PersonnalNSView I want to show.

These are the methods of MyWindowController I used to navigate.

  • (IBAction) previousView:(id) sender { if (![[self currentdView] previousView]) return; [self setCurrentView:[[self currentView] previousView]]; }

  • (IBAction) nextView:(id) sender { if (![[self currentView] nextView]) return; [self setCurrentView:[[self currentView] nextView]]; }

I hope it can help someone =)

Leandro
A: 

A tabless NSTabView can be used for something like this.

Peter Hosey