views:

82

answers:

1

How would you make a button display a window in the same Nib File when it is clicked? Sorry If This Is Vague.

+5  A: 

Set the button's action to makeKeyAndOrderFront: with the other window as the target.

Alex
How would i make the other window the target?
Joshua
You drag a wire from the button's action onto the icon for the other window. Just like you would wire up anything else in IB.
Alex
Do you set it's action to makeKeyAndOrderFront: from Files Owner?
Joshua
When you drag the connection from the button to the window, IB will show a little HUD-styled pop-up menu with a list of available action selectors in it. Click on makeKeyAndOrderFront:.
Peter Hosey
But what connection do I drag?
Joshua
Control-drag from the button to the window, or to the icon for the window in the Nib document window. You might also want to read some of the Interface Builder tutorial information in the documentation...
Mark Bessey