Article View: comp.sys.next.programmer
Article #932Re: Reading in .rtfd files
From: Howard Brenner
Date: Thu, 10 Sep 1992 19:19
Date: Thu, 10 Sep 1992 19:19
25 lines
1515 bytes
1515 bytes
Cecil Bloch writes
> Which ButtonCell? What are you loading the Rich Text into?
> Something else occurred to me -- if all you want to do is open the RTF
> then the best thing might be to message the Workspace Manager to do it,
in
> which case Edit will be launched and the RTF opened:
>
> [[NXApp appSpeaker]
setSendPort:NXPortFromName(NX_WORKSPACEREQUEST,NULL)];
> result = [[NXApp appSpeaker] openFile:filename ok:&ok];
>
>
I actually did something pretty hacky. I did a:
[Text registerDirective:"NeXTGraphic" forClass:[GraphicCell class]];
Where GraphicCell is a subclass of ButtonCell.
In the GraphicCell class I implemented the readRichText:forView: method.
I new that the three parameters following the NeXTGraphic command were the
tiff image name, height and width. I did and NXScanf to get the file name
and using the path of the original RTFD file, i concatted the tiff image
name and did an NXImage initFromFile and set the ButtonCell image to be
that image. Probably not the best way to implement it but it works for
me.
Technical Details
Message-ID:
<BuDMzq.C52@monitor.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!tmc!howardReferences:
<1992Sep10.164942.26132@leland.Stanford.EDU>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!tmc!howard From: howard@monitor.com (Howard Brenner) Subject: Re: Reading in .rtfd files Message-ID: <BuDMzq.C52@monitor.com> Sender: howard@monitor.com (Howard Brenner) Reply-To: howard@monitor.com (Howard Brenner) Organization: Monitor Company / IE References: <1992Sep10.164942.26132@leland.Stanford.EDU> Date: Thu, 10 Sep 1992 19:19:01 GMT Lines: 25