Skip navigation.
 
mlRe: How to pop a window?
FROM : Bus Mini
DATE : Sun Jul 09 16:33:02 2006

Thanks for all of you hlep, I did find my problem, I miss something in
the very beginning.

Thank you very much.

On 7/9/06, Uli Kusterer <<email_removed>> wrote:
> Am 08.07.2006 um 16:44 schrieb Bus Mini:
> > I did connect IBOutlet NSWindow *myWindow to the window which was
> > created in nib.
> >
> > and the followed code is the exactly method was called when a
> > button was cilcked
> >
> > - (IBAction)startToWork:(id)sender
> > {
> >    [myWindow makeKeyAndOrderFront:self];
> > }
> > It doesn't work.
> > And I know another way to pop up a window, but It is not so good, I
> > just pose this to list to ask an easy way.
>
> It *should* work. If it doesn't you forgot something. Try adding a
> line like:
>
> NSLog( @"window: %@", myWindow );
>
> to the method. What does it output to the console?
>
> > - (IBAction)startToWork:(id)sender
> > {
> >  NSRect screenRect = [[NSScreen mainScreen] visibleFrame];
> >
> >
> >      newWindow = [[NSWindow alloc] initWithContentRect:screenRect
> >            styleMask: NSTitledWindowMask|NSClosableWindowMask|
> > NSMiniaturizableWindowMask|NSResizableWindowMask
> >            backing:NSBackingStoreBuffered
> >            defer:NO screen:[NSScreen mainScreen]];//notice that
> > newWindow is not an outlet
> >
> >      [myWindow setFrame: screenRect display:YES];
> >      [newWindow setContentView:[myWindow contentView]];//add
> > myWindow to newWindow
> >
> >
> >      [newWindow makeKeyAndOrderFront:nil];
> >  }
> This shouldn't be necessary at all. What you're doing here is
> creating two windows, then taking the contents of the one from the
> NIB and assigning them to the new window. Then showing the new one.
> This would at most make a difference if you had somehow managed to
> corrupt your NIB file...
>
> Cheers,
> -- M. Uli Kusterer
> http://www.zathras.de
>
>
>



--
Yours sincerely
Mini Bus.

Related mailsAuthorDate
ml[newbie]How to pop a window? Bus Mini Jul 7, 19:25
mlRe: [newbie]How to pop a window? Uli Kusterer Jul 7, 20:33
mlRe: [newbie]How to pop a window? Bus Mini Jul 8, 06:26
mlRe: [newbie]How to pop a window? Uli Kusterer Jul 8, 12:41
mlRe: [newbie]How to pop a window? Bus Mini Jul 8, 16:44
mlRe: [newbie]How to pop a window? I. Savant Jul 8, 17:33
mlRe: How to pop a window? Bus Mini Jul 8, 17:53
mlRe: [newbie]How to pop a window? Shawn Erickson Jul 8, 18:27
mlRe: [newbie]How to pop a window? Uli Kusterer Jul 8, 21:25
mlRe: How to pop a window? Bus Mini Jul 9, 16:33