Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!labrea!polya!ali From: ali@polya.Stanford.EDU (Ali T. Ozer) Newsgroups: comp.sys.next Subject: Re: Interface Builder question Message-ID: <7110@polya.Stanford.EDU> Date: 23 Feb 89 15:30:06 GMT References: <944@blake.acs.washington.edu> Reply-To: aozer@NeXT.com (Ali Ozer) Organization: . Lines: 36 In article <944@blake.acs.washington.edu> Mark Crispin writes: > I can -- and will -- have many instances of these windows on the >screen at the same time. Every time I read a message I'll get a new >read window, etc. So, really the windows I defined via IB (which have >a scrolling text view and some buttons) are prototypes for the windows >I will create. > > However, I am at a total loss for how I should instantiate these >windows. If I call the "new" factory method for the class associated >with each of these windows, then what I get is the tiny default window >made by [Window new]. To create a new window without using IB, use the newContent:style:backing:buttonMask:defer: method in Window. It creates an offscreen window which can be brought on screen with orderFront:. You can use setContentView: and addSubview: to add your own buttons/sliders/views/etc to such a window. Please don't decompile interfaces in IB; the resulting code isn't complete or reliable. There's actually a nice way to generate the prototype window in IB. From the "New..." window, choose "New Object." (This lets you create a new object class independent of any application.) Create your window within the context of this "New Object" project, and save and decompile it. You will get a .nib file which contains the definition of your window and a .m file that contains the method to instantiate such a window, including all the views inside it... All your application has to do is call this object's "new" method to instantiate a window. Hope this helps. Ali Ozer, aozer@NeXT.com NeXT Developer Support