Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!att!watmath!watserv1!watcgl!jvkelley From: jvkelley@watcgl.waterloo.edu (Jeff Kelley) Newsgroups: comp.sys.next Subject: Re: How to obtain object id's loaded with loadNibFile Keywords: loadNibFile Message-ID: <1990May29.010121.17947@watcgl.waterloo.edu> Date: 29 May 90 01:01:21 GMT References: <1990May27.193144.21730@watcgl.waterloo.edu> Distribution: comp Organization: University of Waterloo Lines: 24 In article <1990May27.193144.21730@watcgl.waterloo.edu> jvkelley@watcgl.waterloo.edu (Jeff Kelley) writes: >How can an application determine what objects were loaded >using the Application class' loadNibFile method? > >The nib files being loaded are created independently of the >application. The application may wish to set >text fields, slider settings, etc. of the loaded objects >based upon decisions that can only be made at run time. > Easy, stupid. The id returned by the loadNibFile with be that of the new panel. Use the contentView method to get the panel's view hierarchy, then use the findViewWithTag method to find the controls in the view hierarchy. Of course this requires that unique tags be assigned to the controls, but for sliders, buttons, etc. you can do that with interface builder. If you really want to strain your brain, explain how to set the tag of a custom control (i.e. application created Control subclass) using interface builder. Is it possible? -- Jeff Kelley National Research Council of Canada, Ottawa uunet!watmath!watcgl!jvkelley tel: (613) 990-5924