Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

opening and closing a window programmatically in cocoa

I have two nibs in my project. I have been digging around the interwebs to figure out how to make a button close or hide the nib that the button is on and open another one. The other nib would have a button that does the same thing but in vice versa.

I don't have the faintest idea where to start with this. IF someone could just make a sample class and methods for this i might have something to work with.

like image 466
Joshua Blevins Avatar asked Feb 26 '14 02:02

Joshua Blevins


1 Answers

Remove window from the screen

[window close];


Hide the window (doesn't release it)

[window orderOut:self];

Move the window to the front of its level in the screen list (= show window)

[window orderFront:self];

Check out

  • NSWindow Class Reference
  • Window Programming Guide
like image 81
cacau Avatar answered Nov 26 '22 23:11

cacau