Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!snorkelwacker!bloom-beacon!delphi.it!mago From: mago@delphi.it (Giovanni Beani) Newsgroups: comp.windows.x Subject: Re: motif XmString to char Message-ID: <9010181152.AA00428@lucca.delphi> Date: 18 Oct 90 11:52:59 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 44 In some article, i2unix!lamont!sohara (suzanne ohara) writes: >I am learning to program with motif and have run into what >seems a very simple problem. I have not been able to find >a way to convert a motif XmString to a regular C char string. >Is this possible? I would appreciate any suggestions. >Thank you, >Suzanne O'Hara This is a way to do that: ----- Begin Included Message ----- static char *xm_string_to_string(cs) XmString cs; { XmStringContext context; XmStringCharSet charset; XmStringDirection direction; Boolean separator; static char *primitive_string; XmStringInitContext (&context,cs); XmStringGetNextSegment (context,&primitive_string, &charset,&direction,&separator); XmStringFreeContext (context); return ((char *) primitive_string); } ----- End Included Message ----- Bye Bye Giovanni ----- Giovanni Beani DELPHI S.p.A. "Research Engineering Phone: +39 (584)395225 EMail: gbeani@delphi.uucp & Development Division" Fax : +39 (584)395366 Via Vetraia 11 - 55049 Tlx : 501542 DELPHI I Viareggio (LUCCA) ITALY