Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!nwnexus!adonis1 From: adonis1@nwnexus.WA.COM (Adonis Corporation ) Newsgroups: comp.sys.next Subject: Re: Accessing/updating PopUpLists Message-ID: <460@nwnexus.WA.COM> Date: 23 Jan 91 05:39:02 GMT References: <7885@umd5.umd.edu> Reply-To: adonis1@nwnexus.UUCP (Adonis Corporation (Doug Kent)) Distribution: na Organization: Northwest Nexus Inc.; Seattle, WA Lines: 42 In article <7885@umd5.umd.edu> jkight@sinai.umd.edu (Jeff Kight) writes: > > >The technical docs say: Accessing the PopUpList's Button is useful if you >want to change the title displayed for the list. To access the Button from >your code, give it a tag in the Interface Builder's Inspector. Send a >setTitle: message to the Button to change the title string it displays. If >the title you send isn't represented in the PopUpList, it's added at the top >of the list the next time the user manipulates the Button. > >When I repeatedly add titles to the button, it only "adds" the last one, as >it should by the above definition. If I setTitle then click the button (pop >up the list) and then perform another setTitle, the different titles are >added. > >So, I tried performClick's after setTitle's...no go. > >I try to send PopUpList methods to the button: method not defined. > >I try to form a connection to the PopUpList: can't find a way. I'm no expert on this, but I believe you can gain access to the popup via the target of the button: buttonTarget = [myButton target]. That'll get you into the PopUpList. But for some things you need to go a little deeper and get the id of the matrix which is responsible for displaying the list of items in your PopUpList: popupMatrix = [aPopUp itemList]. This is how I think things worked in 1.0 when you had to build your own PopUpLists from scratch. My limited experience so far with 2.0 is that the model still holds. In 1.0 you were not supposed to set the target of the button to the PopUpList in Interface Builder for some reason, and I presume that still holds, but now IB does it for you, so who cares. I wonder though what would happen if you did set the target of the button to something else? -Doug Kent Independent NeXT Developer