Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!usc!ucsd!ucbvax!osf.org!meeks From: meeks@osf.org (W. Scott Meeks) Newsgroups: comp.windows.x.motif Subject: Re: Selection in list widget Message-ID: <9010111450.AA15831@osf.osf.org> Date: 11 Oct 90 14:50:03 GMT References: <17100002@hpcilzb.HP.COM> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 22 >From: hpcc05!hpcuhb!hpcilzb!bazavan@hplabs.hpl.hp.com (Valentin Bazavan) > >There is no direct way, but it is possible. First, you have to retrieve >XmNselectedItems, XmNselectedItemCount, XmNitems and XmNitemCount resources >using XtGetValues. Then you take each item in the XmNselectedItems list >and compare it against the XmNitems list using XmStringCompare. When a match >occurs, the list position is the index of the matched item in the XmNitems >list plus one. > >Valentin Bazavan >vbazavan@hpdtc.hp.com > In 1.0 its true that this was really the only way to get the positions of the selected items. In 1.1 there is a new function, XmListGetSelectedPos, which takes a widget and returns an array of positions corresponding to the selected items in the list. See the man pages for more details. W. Scott Meeks Open Software Foundation meeks@osf.org (617) 621-7229