views:

119

answers:

1

What are some good NSWindow examples ? I want to start out by writing a simple program that has a window and 2 buttons. Clicking on each button loads a new window in the same view and displays the options. Another option I am considering is a tabbed view where user clicks on tabs and that window loads. I could not find any good tutorials online other than http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html

Any ideas guys ? And thanks a lot in advance.

+2  A: 

The easiest way to make a window is to do so in IB. You'll need to wire the buttons to send action messages to a controller you provide; your controller, in response, should show the second window.

There are a number of variations you can try: In some, the controller loads the nib with itself as owner; in others, the window and controller are both in one nib, such as the MainMenu nib.

Windows don't go in views, by the way. Views go in windows. Specifically, there's a hierarchy of views in each window, starting with the content view.

Peter Hosey