Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!lgc.com!cl From: cl@lgc.com (Cameron Laird) Newsgroups: comp.windows.x.motif Subject: Re: Is position n selected? Keywords: XmList, position, selected Message-ID: <1991Apr19.150134.22593@lgc.com> Date: 19 Apr 91 15:01:34 GMT References: <1991Apr18.212904.21529@lgc.com> <1991Apr18.150819@wsl.dec.com> Sender: usenet@lgc.com Organization: Landmark Graphics Corp., Houston, Tx Lines: 46 Nntp-Posting-Host: forest.lgc.com In article <1991Apr18.150819@wsl.dec.com> klee@wsl.dec.com writes: >In article <1991Apr18.212904.21529@lgc.com>, cl@lgc.com (Cameron Laird) writes: >|> My question: how do I write >|> BOOL XmListPosSelected_p(listWidget, position) >|> Widget listWidget; >|> int position; >|> { >|> /* The entry is selected ... */ >|> if (...) >|> return TRUE; >|> else >|> return FALSE; >|> } > >Check the XmNselectedItems resource and/or XmListGetSelectedPos() >convenience function. . . . Thanks for the quick attention, Ken. It might interest you to know a bit more about what I'm doing: 1. XmNselectedItems: in fact, that's what I'm using now, but it's a problem, because some of my items have identical values. It can happen that my XmList shows string1 string2 string2 string4, the user selects the second "string2" (in position 3), and it is an error for me to treat this the same as if he or she had picked position 2; 2. XmListGetSelectedPos(): this is EXACTLY what I was seeking! What does it mean that it was so hard for me to find it in the re- ferences I have? Thanks again. You have improved products that real-world users will soon (I hope) see. -- Cameron Laird +1 713-579-4613 cl@lgc.com (cl%lgc.com@uunet.uu.net) +1 713-996-8546