Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!swrinde!ucsd!ucbvax!alfalfa.com!MAILER-DAEMON From: MAILER-DAEMON@alfalfa.com (Mail Delivery Subsystem) Newsgroups: comp.windows.x.motif Subject: Returned mail: User unknown Message-ID: <9105170228.AA23453@BU.EDU> Date: 17 May 91 02:28:37 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 67 ----- Transcript of session follows ----- >>> RCPT To: <<< 550 ... User unknown 550 post-motif@ucbvax.berkeley.edu... User unknown ----- Unsent message follows ----- Received: by BU.EDU (1.99) Thu, 16 May 91 22:28:37 EDT Received: by alfalfa.com ( 5.52 (84)/test) id AA00659; Thu, 16 May 91 22:07:12 EDT Received: by alfalfa.com ( 5.52 (84)/test) id AA16470; Thu, 16 May 91 21:36:55 EDT Received: from ucbvax.Berkeley.EDU by BU.EDU (1.99) Thu, 16 May 91 21:07:47 EDT Received: by ucbvax.Berkeley.EDU (5.63/1.42) id AA02830; Thu, 16 May 91 17:55:28 -0700 Received: from USENET by ucbvax.Berkeley.EDU with netnews for motif@alphalpha.com (motif@alphalpha.com) (contact usenet@ucbvax.Berkeley.EDU if you have questions) Date: 16 May 91 22:39:25 GMT From: mips!sdd.hp.com!cs.utexas.edu!news-server.csri.toronto.edu!orasis.vis.toronto.edu!tjhorton@decwrl.dec.com ("Timothy J. Horton") Organization: Department of Computer Science, University of Toronto Subject: Re: How to re-manage the same child widget Message-Id: <91May16.183920edt.8838@orasis.vis.toronto.edu> References: <9105132043.AA11128@11128>, <91May15.224003edt.8838@orasis.vis.toronto.edu>, <1991May16.154512.23319@thyme.jpl.nasa.gov> Sender: motif-request@alfalfa.com To: motif@alfalfa.com kaleb@thyme.jpl.nasa.gov (Kaleb Keithley) writes: >tjhorton@vis.toronto.edu ("Timothy J. Horton") writes: >>jerryl@is.Morgan.COM (Jerry Liebelson) writes: >>> QUESTION: Is there an efficient, trouble-free way to unmanage and >>>re-manage one instance of this XmList under different parent container >>>widgets, which themselves might be contained within different shell widgets? >> >>XtReparent (I think that's what it's called -- no books nearby). > >This fits into the category of dis-information. There is no XtReparent(). >And there is no easy, nor clean way to reparent widgets. This is not my >opinion, but an echo of something Schliefer/Gettys/Converse/et. al. have >said in months gone by. I believe you. Sorry, I guess I was confusing it with the Xlib call for reparenting windows (not widgets). XReparent or XReparentWindow or whatever. >One possible solution would be to GetValues() the XmNitems resource from >one and SetValues() it onto the other. Since this is fast and simple, >it's the way I would go. This won't answer Jerry's question; his list is very large and he wants only one instance of the XmList. He'll have several copies because XtSetValues on the XmNitems resource causes a list widget to allocate and make a copy of the entire list. If you no longer need access to the list that you provided to a list widget, you can destroy it, because the list widget has its own private copy. Most motif widgets are like this; they reallocate copies of whatever you give them via pointers. Furthermore, if you fetch back resource values via pointers, most widgets allocate yet another copy of the resource and pass back the new copy, which you normally have to free explicitly. I had an application in which I needed to very quickly swap large lists in and out of a list widget, but couldn't, because the dang list widget always freed its old list and allocated and copied the new one. I had to write my own code from scratch to display selection lists without copying them. [Sorry for the earlier disinformation, and thanks for catching it] Tim