Re: Creating a window when pressing a button

2008-12-09 Thread Rob Rix
It sounds like you might want to set up the window in a new nib file, which you load and unload with NSWindowController by creating a new NSWindowController instance and then calling -showWindow: on it. This also gives you a convenient location to start adding controller code for the conten

Re: Creating a window when pressing a button

2008-12-09 Thread Damien Cooke
Jushin, Here is an example loading from nib within an action method - (IBAction)showMyNewWindow:(id)sender { NSLog(@"Loading Nib"); if(!myNewWindow) { [NSBundle loadNibNamed:@"MyNewWindow" owner:self]; } [myNewWindow makeKeyAndOrderFront:nil

Re: Creating a window when pressing a button

2008-12-09 Thread Damien Cooke
Jushin, What I have done in the past with these sort of issues is either load the nib in the button pushed action or depending on how complicated your secondary window is, you could programatically create it like this. myWindow = [[NSWindow alloc] initWithContentRect:myRect styleMask:NSTi

Creating a window when pressing a button

2008-12-09 Thread Jushin
In my application, I have to open a form window when a user press a button. It is somewhat similar to Apple Mail. In Apple Mail, if you click "New Message" button from the toolbar, a "New Message" window is appeared. For now, what I did was something like this: In IB, I added a window (or a panel)