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