Thread View: comp.sys.next.programmer
3 messages
3 total messages
Started by Matt Brandt
Wed, 23 Dec 1992 23:32
Multiple instances of IB objects
Author: Matt Brandt
Date: Wed, 23 Dec 1992 23:32
Date: Wed, 23 Dec 1992 23:32
8 lines
712 bytes
712 bytes
If I create a window in IB with lots of gadgets and connections in it how can I get multiple instances of that window that act correctly at runtime? The -copy method of Object won't do it because it doesn't copy secondary objects (objects pointed to within the primary object). Anybody got a good method of doing this? Matt Brandt matt@drefla.mese.com
Re: Multiple instances of IB objects
Author: Ray Spalding
Date: Thu, 24 Dec 1992 19:11
Date: Thu, 24 Dec 1992 19:11
21 lines
1578 bytes
1578 bytes
In article <1992Dec23.233230.1472@drefla.mese.com> matt@drefla.mese.com (Matt Brandt) writes: >If I create a window in IB with lots of gadgets and connections in it how >can I get multiple instances of that window that act correctly at >runtime? One way is to create your interface that is to be duplicated in a separate (non-main) nib file, using Document->New Module in IB. You also create (but don't instantiate in IB) a custom Object to be the "File's Owner" of this nib file. To duplicate the interface, in your main code you make a new instance of your custom object with [[customObject alloc] init]. In the customObject "init" method, you do a [NXApp loadNibSection:"myDocument" owner:self]. This instantiates a new copy of everything in your secondary nib file. Any connections to the "File's Owner" in your secondary nib file are linked up to the instance of your customObject you just created above. -- Ray Spalding, Office of Information Technology Georgia Institute of Technology, Atlanta Georgia, 30332-0715 Internet: ray.spalding@oit.gatech.edu (NeXT Mail accepted)
Re: Multiple instances of IB objects
Author: Mikael Behrens
Date: Fri, 25 Dec 1992 19:31
Date: Fri, 25 Dec 1992 19:31
18 lines
1122 bytes
1122 bytes
Matt Brandt writes | If I create a window in IB with lots of gadgets and connections in it how | can I get multiple instances of that window that act correctly at | runtime? The -copy method of Object won't do it because it doesn't copy | secondary objects (objects pointed to within the primary object). Anybody | got a good method of doing this? | | Matt Brandt | matt@drefla.mese.com What you need to do is put the window (and all its gadgets) into its own nib file. This nib file can be dynamically loaded as many times as you like, creating new instances each time. There's a tutorial in the 3.0 online documentation that shows exactly how to do this. Mikael
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads