• 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: Showing a window from a second nib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Showing a window from a second nib


  • Subject: Re: Showing a window from a second nib
  • From: Tom Harrington <email@hidden>
  • Date: Sun, 06 Jan 2002 17:12:21 -0700

email@hidden wrote:

Make AboutController be a subclass of NSWindowController instead of NSObject, then window will already be declared as an outlet and showWindow: will already be implemented.

Then load the nib in when you construct the controller, not in showWindow.


Heh, I see I'm not the only reader of this list who's reading Aaron Hillegass's book right now. :-)


<snip details>


ps. if your window is just an about box, that really has no target methods, you don't even need to write a controller... just use NSWindowController, and hook everything up in IB to allow a button to close it.


I also wrote this using a controller class, mainly because that's how this "challenge" problem was stated. I'd like to try your approach here but I'm not sure I understand it. Obviously the nib file can be loaded without a controller class, but if so, how would I connect the "About..." menu item to the display of the box? I did it by setting the menu item's "target" outlet to call a specific method in the controller, which then sends -makeKeyAndOrderFront:self to the panel. I'm not sure how I'd make this link without a controller.
--
Tom Harrington, Cybernetic Entomologist
email@hidden


  • Follow-Ups:
    • Re: Showing a window from a second nib
      • From: email@hidden
References: 
 >Re: Showing a window from a second nib (From: email@hidden)

  • Prev by Date: thanks
  • Next by Date: re: locationInWindow not valid for key event (as opposed to mouse event)?
  • Previous by thread: Re: Showing a window from a second nib
  • Next by thread: Re: Showing a window from a second nib
  • Index(es):
    • Date
    • Thread