home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / next / programm / 7909 < prev    next >
Encoding:
Internet Message Format  |  1992-12-24  |  1.5 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!usc!howland.reston.ans.net!paladin.american.edu!gatech!prism!xray.gatech.edu!cc100aa
  2. From: cc100aa@xray.gatech.edu (Ray Spalding)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: Multiple instances of IB objects
  5. Message-ID: <78800@hydra.gatech.EDU>
  6. Date: 24 Dec 92 19:11:20 GMT
  7. References: <1992Dec23.233230.1472@drefla.mese.com>
  8. Sender: news@prism.gatech.EDU
  9. Organization: Georgia Institute of Technology
  10. Lines: 21
  11.  
  12. In article <1992Dec23.233230.1472@drefla.mese.com> matt@drefla.mese.com (Matt Brandt) writes:
  13. >If I create a window in IB with lots of gadgets and connections in it how  
  14. >can I get multiple instances of that window that act correctly at  
  15. >runtime?
  16.  
  17. One way is to create your interface that is to be duplicated in a
  18. separate (non-main) nib file, using Document->New Module in IB.
  19. You also create (but don't instantiate in IB) a custom Object to
  20. be the "File's Owner" of this nib file.
  21.  
  22. To duplicate the interface, in your main code you make a new instance
  23. of your custom object with [[customObject alloc] init].  In the
  24. customObject "init" method, you do a
  25. [NXApp loadNibSection:"myDocument" owner:self].  This instantiates
  26. a new copy of everything in your secondary nib file.  Any connections
  27. to the "File's Owner" in your secondary nib file are linked up to
  28. the instance of your customObject you just created above.
  29. -- 
  30. Ray Spalding, Office of Information Technology
  31. Georgia Institute of Technology, Atlanta Georgia, 30332-0715
  32. Internet: ray.spalding@oit.gatech.edu (NeXT Mail accepted)
  33.