tph@cs.utexas.edu (Pow-Hwee Tan) (02/12/91)
Hi, I have a programming question. How does one find out the ids of objects created by Interface Builder? Specifically, I created a list of radio buttons (controls) and I need to reset their settings according to values stored in a file. This require me to know their id's. Pardon me if this problem is too trivial. Thanks in advance. -- ph tan tph@cs.utexas.edu
adonis1@nwnexus.WA.COM (Adonis Corporation ) (02/12/91)
In article <222@qt.cs.utexas.edu> tph@cs.utexas.edu (Pow-Hwee Tan) writes: >Hi, > > I have a programming question. How does one find out the ids of >objects created by Interface Builder? > > Specifically, I created a list of radio buttons (controls) and >I need to reset their settings according to values stored in a >file. This require me to know their id's. > I'm not sure I understand what you're trying to do, but perhaps what you want is the 'tag' which you can set in Interface Builder and obtain via the 'tag' method. Doug Kent Independent Next Developer
aozer@next.com (Ali Ozer) (02/13/91)
In article <467@nwnexus.WA.COM> Doug Kent writes: >In article <222@qt.cs.utexas.edu> Pow-Hwee Tan writes: >> I have a programming question. How does one find out the ids of >>objects created by Interface Builder? > >I'm not sure I understand what you're trying to do, but perhaps what you >want is the 'tag' which you can set in Interface Builder and obtain >via the 'tag' method. Sounds like you need to use outlets. Outlets are instance variables of type id. Interface Builder allows you to visually connect outlets to other objects; thus you can get handles to objects created through IB. In your case, you'd probably want some central object (your subclass of Application, some controller, or an instance of your document class) to have an outlet which points at the matrix of radio buttons, or, if you wish, you can have a bunch of outlets pointing at the individual cells. The CalculatorLab example (in /NextDeveloper/Examples) shows the use of outlets (in the way the SimpleCalc object gets a handle to the TextField used to display results, for instance), as do some of the other examples. Ali, Ali_Ozer@NeXT.com
moose@svc.portal.com (02/15/91)
In article <467@nwnexus.WA.COM> adonis1@nwnexus.UUCP (Adonis Corporation (Doug Kent)) writes: >In article <222@qt.cs.utexas.edu> tph@cs.utexas.edu (Pow-Hwee Tan) writes: >> Specifically, I created a list of radio buttons (controls) and >>I need to reset their settings according to values stored in a >>file. This require me to know their id's. >I'm not sure I understand what you're trying to do, but perhaps what you >want is the 'tag' which you can set in Interface Builder and obtain >via the 'tag' method. While I use the tag method now, after spending an afternoon at NeXT I found out something interesting. Programmers at NeXT no longer use tags at all. They use the object name. Since names mean more to me than numbers, I am moving all my stuff over from tags to names. -- Michael Rutman | moose@svc.portal.com Cubist | makes me a NeXT programmer Software Ventures | For Your Eyes Only Public Key