Article View: comp.sys.next.programmer
Article #2234RTFD, copying to Objects and Archiving
From: John W. Wooten
Date: Thu, 07 Jan 1993 21:30
Date: Thu, 07 Jan 1993 21:30
55 lines
1770 bytes
1770 bytes
I am working on an application where I compose questions
that will contain rich text (including diagrams). I have a simple
subclass of Object called QuestionObj that I create an instance of for
each question and then maintain the questions in a List Object.
The text is in a text field with id "text".
I try to do the following:
NXStream *buffer;
count = [questions count];
newQuestion = [[QuestionObj alloc] init];
buffer = NXOpenMemory(NULL,0,NX_WRITEONLY);
[text writeRTFDTo:buffer];
[newQuestion setText:buffer];
Now in the QuestionObj, I have:
- setText:(NXStream *)str
{
buffer = str;
return self;
}
- (NXStream *)text
{
return buffer;
}
with interface of:
@interface QuestionObj:Object
{
int num;
NXStream *buffer;
}
- setNum:(int)val;
- (int)num;
- setText:(NXStream *)str;
- (NXStream *)text;
Now, first it appears that I'm not getting the Rich Text because I
can't get it back out of the object with text method.
I know most of this works with ascii text (I tried this all out using
char *buffer;
first)
Also, if this even works, in the -read -write methods of the
QuestionObj class, what do I put for the descriptor when I use
NXWriteTypedStreamToFile ?
I used a * when it was a char * and it worked.
What do I put for a typed stream?
- - - - - - - - -
J. W. Wooten
Technical Details
Message-ID:
<1993Jan7.213019.7023@ornl.gov>Path:
arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!darwin.sura.net!cs.utk.edu!ornl!usenetShow Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!darwin.sura.net!cs.utk.edu!ornl!usenet From: woo@ornl.gov (John W. Wooten) Subject: RTFD, copying to Objects and Archiving Message-ID: <1993Jan7.213019.7023@ornl.gov> Sender: usenet@ornl.gov (News poster) Reply-To: woo@ornl.gov Organization: Oak Ridge National Laboratory Date: Thu, 7 Jan 1993 21:30:19 GMT Lines: 55