[comp.windows.x.motif] Carriage returns in Label Widget Text

randy@erik.UUCP (Randy Brown) (07/28/90)

>> XmStringLineCount, XmStringBaseLine, ...). Can anyone say if there is
>> any way to create a multi-line string except for XmStringCreateLtoR?
>
>I've always assumed that's what XmStringSeparatorCreate does, although
>I've never tried it.

Well, a separator is "simply a tag with no value...that allows an array
of segments to be presented as a single entity."  If you make the leap
of faith to segment == line, you should be a neoorthodox theologian
specializing in form criticism.  On the other hand, you may be
correct.  Perhaps someone listening in knows or has the time to do the
experiment. ... rb

pd@ixi.uucp (Paul Davey) (08/03/90)

In article <9007271707.AA23113@alphalpha.com> 
nazgul@alphalpha.com (Kee Hinckley) writes:

   > XmStringLineCount, XmStringBaseLine, ...). Can anyone say if there is
   > any way to create a multi-line string except for XmStringCreateLtoR?

   I've always assumed that's what XmStringSeparatorCreate does, although
   I've never tried it.

Yes, alternatively XmStringSegmentCreate allows a separator to be
created at the same time as a character set segement.  

The following code creates separators after word0 and word2.

If you place it in a label you get something like

+-----------+
|word0 word1|
|   word2   |
+-----------+

s0=XmStringSegmentCreate("word0",XmSTRING_DEFAULT_CHARSET,
	XmSTRING_DIRECTION_L_TO_R,FALSE);
s1=XmStringSegmentCreate("word1",XmSTRING_DEFAULT_CHARSET,
	XmSTRING_DIRECTION_L_TO_R,TRUE);
s1=XmStringConcat(s0,s1);
s2=XmStringSegmentCreate("word2",XmSTRING_DEFAULT_CHARSET,
	XmSTRING_DIRECTION_L_TO_R,TRUE);
string=XmStringConcat(s1,s2);

The separator after word2 has no apparent effect.

Multiple separators have the effect of one.

--
 Regards,			 pd@x.co.uk          IXI Limited
	Paul Davey		 pd@ixi.uucp         62-74 Burleigh St.
				 ...!uunet!ixi!pd    Cambridge  U.K.
 "These are interesting times"   +44 223 462 131     CB1  1OJ      

pd@x.co.uk (Paul Davey) (08/06/90)

   > Multiple separators have the effect of one.
   That seems wrong.

Perhaps I should have hedged my comment slightly, 

>> Multiple separators seem have the effect of one. << 

I'm not sure if this is a bug or a feature, (I suspect it may be the
latter). Maybe someone from OSF can comment.


 Regards,			 pd@x.co.uk          IXI Limited
	Paul Davey		 pd@ixi.uucp         62-74 Burleigh St.
				 ...!uunet!ixi!pd    Cambridge  U.K.
 "These are interesting times"   +44 223 462 131     CB1  1OJ