ftp.nice.ch/peanuts/GeneralData/Usenet/news/1989/CSN-89.tar.gz#/comp-sys-next/1989/Jul/Setting-a-PopUpLists-selection

This is Setting-a-PopUpLists-selection in view mode; [Up]


Date: Sun 01-Jul-1989 00:57:48 From: Unknown Subject: Setting a PopUpList's selection 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 Jacob
Date: Sun 08-Jul-1989 07:22:18 From: Unknown Subject: Re: Setting a PopUpList's selection / comp.sys.next / jacob@gore.com (Jacob Gore) / Jun 30, 1989 / > Given an instance of PopUpList, how do you select, from the program, an > item in it? > ... > 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] Duh... get used to RTFM all they way up the inheritance chain, Jacob... Anyway, in case anybody else is waiting for the answer: PopUpList inherits from Matrix method 'itemList', which returns the matrix. So, what I was looking for was: [[thePopUpList itemList] selectCellAt:itemNumber:0] Now, if I could only figure out why doing the selectCellAt:: has no effect on the appearance of the pop-up list...
Date: Sun 08-Jul-1989 22:12:38 From: Unknown Subject: Re: Setting a PopUpList's selection In article <130011@gore.com>, jacob@gore.com (Jacob Gore) writes: > Now, if I could only figure out why doing the selectCellAt:: has no effect > on the appearance of the pop-up list... I believe you also need to set the title of the button if you are doing the selection yourself . . . -tom >From: hunt@tramp.Colorado.EDU (Lee Cameron Hunt)

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.