home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / programm / 5674 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  1.5 KB

  1. Path: sparky!uunet!wupost!gumby!yale!mintaka.lcs.mit.edu!ai-lab!next.cambridge.ma.us!simsong
  2. From: simsong (Simson L. Garfinkel)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: [textObj1 readRichText: [textObj2 stream]]
  5. Message-ID: <1992Aug18.134829.8420@next.cambridge.ma.us>
  6. Date: 18 Aug 92 13:48:29 GMT
  7. References: <1992Aug17.211456.14181@Trirex.COM>
  8. Sender: simsong@next.cambridge.ma.us
  9. Reply-To: simsong@next.cambridge.ma.us
  10. Organization: Simson Garfinkel and Associates, Inc.
  11. Lines: 27
  12.  
  13. In article <1992Aug17.211456.14181@Trirex.COM> mmelling@Trirex.com (Michael  
  14. Mellinger) writes:
  15. > When I try to set the text of one text object to be that of another text  
  16. > object (the subject line puts it simpler), I get all of the text but the  
  17. > linefeeds are missings, including the hard returns at the end of  
  18. > paragraphs.  Is there something obvious that I'm overlooking when trying  
  19. > to copy the text from one text object to another?  I hope that I'm not  
  20. > going to get stuck looking at theBreaks variable in the Text object and  
  21. > pulling each line out one by one.
  22. > -Mike
  23.  
  24. This isn't the approved way to do this.  Sadly, you've got to write the first  
  25. Text object into a memory buffer, than read it out.
  26.  
  27. Try this:
  28.  
  29.     NXStream    *str = NXOpenMemory(0,0,NX_READWRITE);
  30.     [text1        writeRichText:str];
  31.     NXSeek(str,0L,NX_FROMSTART);
  32.     [text2        readRichText:str];
  33.     NXCloseMemory(str,NX_FREEBUFFER);
  34.  
  35. It's still quite zippy.
  36. -- 
  37.  
  38. ................................................................simson
  39.