• 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: NSWindow display?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindow display?


  • Subject: Re: NSWindow display?
  • From: Jeremy Dronfield <email@hidden>
  • Date: Mon, 19 Apr 2004 20:32:59 +0100

Connect your window to your window controller's "window" outlet (you don't need to create an outlet - it's there already in NSWindowController). Then it's

[self showWindow:nil];

-showWindow: is an action method and takes an (id)sender argument. It's also a window controller method, so it's sent to the controller, not the window. Here the sender is passed as nil, because the method is called from within the window controller.

The documentation isn't much use if you're right at the beginning learning Cocoa. I'd advise doing some tutorials. There are quite a few available online.

Regards
Jeremy


On 19 Apr 2004, at 7:26 pm, David Piasecki wrote:

This has got to be a dumb question, but how do you display a new NSWindow in Cocoa? I created a new NSWindow in IB, I created an outlet for the window in my main window's controller class, and I created an action to open the new window when I click on a button. I tried the following...

[newWindow display]
[newWindow setNeedsDisplay:true]
[newWindow showWindow]
[newWindow makeKeyAndOrderFront]

But none of that seems to work. This is obviously really basic. I'm just missing something and can't seem to find it in the documentation.

David
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >NSWindow display? (From: "David Piasecki" <email@hidden>)

  • Prev by Date: Re: NSWindow display?
  • Next by Date: Re: sheet weirdness
  • Previous by thread: Re: NSWindow display?
  • Next by thread: NSScrollView / NSTextView questions
  • Index(es):
    • Date
    • Thread