Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!bionet!agate!shelby!lindy!giant From: giant@lindy.Stanford.EDU (Buc Richards) Newsgroups: comp.sys.next Subject: Interface Builder question Message-ID: <9867@lindy.Stanford.EDU> Date: 7 Jun 90 00:19:12 GMT Sender: giant@lindy.Stanford.EDU (Buc Richards) Reply-To: giant@lindy.Stanford.EDU (Buc Richards) Distribution: usa Organization: Stanford University Lines: 35 I have built a set of interface files for a project using Interface Builder. In particular I have a window with a bunch of standard objects in it called Inspector Window. I have a menu button called Inspector under the Window button that is connected to the makeKeyandOrderFront action of this window, which works fine. The question is, how can I gain access to the window objects from the .m programs *outside* of Interface Builder? I can connect to the Key Window of course, but there is no guarantee at any time that this will be the key window. As a concrete example, I have a text field in the window that I would like to display the name of a currently open file. Open is connected to File's Owner of course, and there is the standard code for running an open panel there. Ideally, I would like to also send some kind of message at that time of the form appropriateWindow = ? appropriateTextField = [appropriateWindow getAppropriateTextField]; [appropriateTextField read:stream]; (note that this is a recursive problem). The nib file has provided me with the standard action - setInspectorWindow:anObject { inspectorWindow = anObject; return self; } but calling [self setInspectorWindow] doesn't do anything (what should the argument be, by the way?). This seems like it should be trivial, but as I say I have not really been able to find this problem/solution clearly stated in the manuals. It's pretty clear how to do these things if you set up all the windows by hand, outside of IB, but then IB doesn't do much good. Thanks for any pointers.