Newsgroups: comp.windows.x.motif Path: utzoo!utgpu!cunews!bnrgate!scrumpy!bnrmtl@bnr.ca!paar From: paar@bnrmtl.bnr.ca (A.E. Paar) Subject: XmList widget nuisance. Message-ID: <1991Jun6.181622.29296@scrumpy@.bnr.ca> Sender: news@scrumpy@.bnr.ca (USENET NEWS KJ) Reply-To: bnrmtl!paar@larry.mcrcim.mcgill.edu Organization: Bell-Northern Research, Montreal Date: Thu, 6 Jun 91 18:16:22 GMT I am having a problem with the way the XmList widget works using XmEXTENDED_SELECT. My problem is as follows, I build a list of XmString's based on a list of C++ objects, in the same window I have a couple of buttons that indicate an action to be taken on the selected items, how do I get back to my C++ object from the selected items? I'm using Motif 1.0. The most elaborate way I've tried to do it so far is to keep the address of each XmString of the list widget after its creation and then match the address of the selected ones after a button press. This doesn't work because the widget keeps a separate list of selected XmStrings (for which it allocates and deallocates space in memory as the selections progress, BTW does anyone know why it's done this way, I think it's sort of silly but I may be missing something). All the values that I'm talking about are fetched using XtGetValues for the XmNitems and XmNselectedItems. The only workaround that I've managed to implement is to use XmSINGLE_SELECT and use the item_position value in the XmListCallbackStruct in a singleSelectionCallback. Another problem with the XmList widget that I've encountered is that I haven't yet found a way of changing one character of an element in list from the code. The only thing that I've done so far is to delete the item at a given position, create a new XmString and insert it at the same position. Can anyone help me with these problems? ------------------------------------------------------------------- aep bnrmtl!paar@larry.mcrcim.mcgill.edu Augustin E. Paar Bell-Northern Research, Montreal, Quebec Opinions are my own and often not that of my management. -------------------------------------------------------------------