Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!usc!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: <9105171026.AA15284@BU.EDU> Date: 17 May 91 10:26:27 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 61 ----- 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) Fri, 17 May 91 06:26:27 EDT Received: by alfalfa.com ( 5.52 (84)/test) id AA01071; Fri, 17 May 91 04:37:02 EDT Received: by alfalfa.com ( 5.52 (84)/test) id AA17283; Fri, 17 May 91 03:47:31 EDT Received: from ucbvax.Berkeley.EDU by BU.EDU (1.99) Fri, 17 May 91 01:54:39 EDT Received: by ucbvax.Berkeley.EDU (5.63/1.42) id AA09703; Thu, 16 May 91 22:48:29 -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: 17 May 91 03:06:10 GMT From: sdd.hp.com!cs.utexas.edu!news-server.csri.toronto.edu!neat.cs.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.230552edt.6244@neat.cs.toronto.edu> References: <91May16.183920edt.8838@orasis.vis.toronto.edu> Sender: motif-request@alfalfa.com To: motif@alfalfa.com Let me get this right the second time tjhorton@vis.toronto.edu ("Timothy J. Horton") writes: >Most motif widgets are like this; they reallocate copies of whatever you give >them via pointers. (using *either* XtSetValues or convenience routines) >Furthermore, if you fetch back resource values via pointers, USING CONVENIENCE ROUTINES SUCH AS "XmTextGetString", ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >most widgets allocate yet another copy of the resource and pass back the new >copy, which you normally have to free explicitly. XtGetValues normally bypasses this copy/free cycle. For instance, XmTextGetString gives you a *copy* of the text widget's internal buffer, wheras XtGetValues on its XmNvalue returns a pointer to the text widget's internal buffer. Thus, getting and setting are different. >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. Someone asked about this -- I just used a drawing area and a scrollbar, and the input callback from the drawing area for item selection. I don't have the code (now belongs to a previous client), but it only took a day to write, except that it required some messy Xlib hacking. Tim