• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [newbie]How to pop a window?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [newbie]How to pop a window?


  • Subject: Re: [newbie]How to pop a window?
  • From: "Bus Mini" <email@hidden>
  • Date: Sat, 8 Jul 2006 22:44:33 +0800

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.


- (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]; } Thanks for you advice, could you give me an example?





--
Yours sincerely
Mini Bus.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: [newbie]How to pop a window?
      • From: Uli Kusterer <email@hidden>
    • Re: [newbie]How to pop a window?
      • From: Shawn Erickson <email@hidden>
    • Re: [newbie]How to pop a window?
      • From: "I. Savant" <email@hidden>
References: 
 >[newbie]How to pop a window? (From: "Bus Mini" <email@hidden>)
 >Re: [newbie]How to pop a window? (From: Uli Kusterer <email@hidden>)
 >Re: [newbie]How to pop a window? (From: "Bus Mini" <email@hidden>)
 >Re: [newbie]How to pop a window? (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Stealing keyboard focus without activating
  • Next by Date: Re: iPhoto integration?
  • Previous by thread: Re: [newbie]How to pop a window?
  • Next by thread: Re: [newbie]How to pop a window?
  • Index(es):
    • Date
    • Thread