home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / windows / x / motif / 8785 < prev    next >
Encoding:
Internet Message Format  |  1993-01-23  |  981 b 

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!ucbvax!zander.z-code.com!argv
  2. From: argv@zander.z-code.com (Dan Heller)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Re: Text widgets - solution with one stroke "delay"
  5. Message-ID: <9301221732.ZM11620@zander.z-code.com>
  6. Date: 23 Jan 93 01:32:54 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Reply-To: argv@z-code.z-code.com
  9. Distribution: inet
  10. Organization: The Internet
  11. Lines: 16
  12.  
  13. > On Jan 22,  5:10pm, Prakash Baskaran wrote:
  14. > char  *select_to_beginning ( pos, w )
  15. ...
  16. >   full_text = XmTextGetString ( w );
  17. >   sel_text = (char *) malloc ( (pos) * sizeof (char) );
  18. >   strncpy ( sel_text, full_text, pos);
  19. >   return (sel_text);
  20.  
  21. do you realize how much memory you're losing here/  XmTextGetString
  22. returns *MALLOC'ED* memory -- you're just allocating more memory and
  23. copying it again.  Just use the original text you get.
  24.  
  25. sorry I can't help you with the rest of this...       :-|
  26.  
  27.   --dan
  28.  
  29.