• 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: Creating a window when pressing a button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a window when pressing a button


  • Subject: Re: Creating a window when pressing a button
  • From: Rob Rix <email@hidden>
  • Date: Tue, 9 Dec 2008 17:56:44 -0500

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 contents of the new windows; you can subclass NSWindowController and add them to that object, which will be the File’s Owner of the new nib.

Rob

On 9-Dec-08, at 4:24 PM, Jushin wrote:

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), and the associated button shows
the window by using makeKeyAndOrderFront method when pressed.
However, I realized it is not what I want.
In this case, a window is already created, and the button only shows
or hides the window.
What I want is really creating a window when a user presses the
button, so that the user can creates multiple windows by pressing the
button.
I wonder how can I do this.
The window will contain form fields to get values for Core Data models.


Thanks,
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Creating a window when pressing a button (From: Jushin <email@hidden>)

  • Prev by Date: Re: NSArrayController with a base class
  • Next by Date: Fix for Core Data + NSTreeController + NSOutlineView Crashes?
  • Previous by thread: Re: Creating a window when pressing a button
  • Next by thread: Cocoaheads Lake Forest (92630) meeting 11/12/2008 at 7 pm on "Using and optimizing Core Data in a commercial application"
  • Index(es):
    • Date
    • Thread