home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / next / programm / 6097 < prev    next >
Encoding:
Text File  |  1992-09-10  |  1.4 KB  |  38 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!tmc!howard
  3. From: howard@monitor.com (Howard Brenner)
  4. Subject: Re: Reading in .rtfd files
  5. Message-ID: <BuDMzq.C52@monitor.com>
  6. Sender: howard@monitor.com (Howard Brenner)
  7. Reply-To: howard@monitor.com (Howard Brenner)
  8. Organization: Monitor Company / IE
  9. References: <1992Sep10.164942.26132@leland.Stanford.EDU>
  10. Date: Thu, 10 Sep 1992 19:19:01 GMT
  11. Lines: 25
  12.  
  13. Cecil Bloch writes
  14. > Which ButtonCell?  What are you loading the Rich Text into?
  15. > Something else occurred to me -- if all you want to do is open the RTF  
  16. > then the best thing might be to message the Workspace Manager to do it,  
  17. in  
  18. > which case Edit will be launched and the RTF opened:
  19. > [[NXApp appSpeaker]  
  20. setSendPort:NXPortFromName(NX_WORKSPACEREQUEST,NULL)];
  21. > result = [[NXApp appSpeaker] openFile:filename ok:&ok];
  22.  
  23. I actually did something pretty hacky.  I did a:
  24.     [Text registerDirective:"NeXTGraphic" forClass:[GraphicCell class]];
  25.  
  26. Where GraphicCell is a subclass of ButtonCell.
  27.  
  28. In the GraphicCell class I implemented the readRichText:forView: method.   
  29. I new that the three parameters following the NeXTGraphic command were the  
  30. tiff image name, height and width.  I did and NXScanf to get the file name  
  31. and using the path of the original RTFD file, i concatted the tiff image  
  32. name and did an NXImage initFromFile and set the ButtonCell image to be  
  33. that image.  Probably not the best way to implement it but it works for  
  34. me.
  35.