Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!accuvax.nwu.edu!nucsrl!gore!jacob From: jacob@gore.com (Jacob Gore) Newsgroups: comp.sys.next Subject: Setting a PopUpList's selection Message-ID: <130006@gore.com> Date: 1 Jul 89 00:57:48 GMT Reply-To: jacob@gore.com (Jacob Gore) Organization: Gore Enterprises Lines: 28 Given an instance of PopUpList, how do you select, from the program, an item in it? The only ways I can think of doing this are all yucky. One way is capture the 'sender' of the first click as the Matrix instance that the PopUpList is using, and then do something like [theMatrix selectCellAt:itemNumber:0] (uhm... that's assuming that pop-up list's are represented vertically in the matrix... are they?). But this only works after a click on the list. Yuck. Another way, possibly, is to play with pop-up lists until I can figure out a way to insert things that ends up with the right thing selected (effect of inserting or adding items on the selected item is not documented in the PopUpList class description). Double yuck, and probably futile anyway. I am trying to have an int instance variable that stores the current selection in a corresponding pop-up list. I need that variable to change when the list's selected item changes (easy enough), and vice versa. Is there a particular reason why there is no setSelectedItem: (or selectItem:) instance method in PopUpList? Jacob -- Jacob Gore Jacob@Gore.Com {nucsrl,boulder}!gore!jacob