Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!unido!orthogo!basti From: basti@orthogo.UUCP (Sebastian Wangnick) Newsgroups: comp.windows.x Subject: Motif XmString converter buggy? Keywords: Motif XmString Converter Bug Message-ID: <764@orthogo.UUCP> Date: 9 May 90 08:50:04 GMT Distribution: comp Organization: none Lines: 47 How do I write a multiline Motif XmString within my resource file? The manual claims: ``Specifying a string in a defaults file is the same as creating the string using XmStringCreateLtoR with the default character set XmSTRING_DEFAULT_CHARSET.'' But it seems that the String-to-XmString-Converter gobbles all my newlines, whereas XmStringCreateLtoR correctly replaces newlines with seperators. Here's nlxmstr.c: #include #include #include #define CHARSET (XmStringCharSet) XmSTRING_DEFAULT_CHARSET Arg args[20]; Cardinal n; #define HEAD(name,value) XtSetArg(args[n=0],name,value); n++ #define NEXT(name,value) XtSetArg(args[n],name,value); n++ #define LIST args,n #define NOLIST NULL,0 void main (argc, argv) unsigned int argc; char **argv; {Widget nlxmstr = XtInitialize("nlxmstr","Test",NOLIST,&argc,argv); Widget container = XmCreateRowColumn(nlxmstr,"container",NOLIST); static XtResource resources[] = { {"teststring",XmCUserData,XmRString,sizeof(char*), 0,XmRString,"default"}, }; char * teststring; XtGetApplicationResources(nlxmstr,&teststring, resources,XtNumber(resources),NOLIST); XtManageChild(container); XtManageChild(XmCreateMessageBox(container,"messagebox1",NOLIST)); HEAD(XmNmessageString,XmStringCreateLtoR(teststring,CHARSET)); XtManageChild(XmCreateMessageBox(container,"messagebox2",LIST)); printf("teststring: \"%s\"\n",teststring); XtRealizeWidget(nlxmstr); XtMainLoop(); } And this is my nlxmstr.xrdb: nlxmstr.teststring: Line 1\nLine 2\n\nLine 4 nlxmstr.container.messagebox1.messageString: Line 1\nLine 2\n\nLine 4 The incorrect behaviour shows up on both an Apollo and a Unix-PC. Who can help? Sebastian Wangnick (basti@orthogo.uucp)