alleyne@teecs.UUCP (Adrian Alleyne) (09/25/90)
I am trying to create a label that has an imbedded newline character. eg. Line One Of Label Line Two: If I use the following it works ok. XtSetArg (arglist[n], XmNlabelString, XmStringCreateLtoR ("Line One Of Label \n Line Two:", XmSTRING_DEFAULT_CHARSET)); Problem - How can I insert a newline character into the resource file? Note the following does NOT work: *LABEL_NAME.labelString: "Line One Of Label \n Line Two:" Thanks in advance, ---------------------------------------------------------------------- Adrian Alleyne email: alleyne@teecs.UUCP Litton Systems Canada Limited voice: (416) 249-1231 Etobicoke, Ont. Canada M9W 5A7
krs0@GTE.COM (Rod Stephens) (09/27/90)
This probably doesn't help with resource files but it may be of interest. I have created labels with imbedded carriage returns in Motif UIL files with: XmNlabelString = compound_string('Create', separate=true) & 'list'; +---------------------------------------------------------------+ | Rod Stephens | "Haven't I told you not to play | | GTE Laboratories, Inc | with my super-weapons? You might | | (617)466-4182 | devastate yourself!" | | krs0@gte.com | | +---------------------------------------------------------------+
hammy@bagheera.ctt.bellcore.com (John G. Smith) (09/28/90)
This is not an answer to the problem of putting a newline into a labelstring, just a related issue that I've found somewhat annoying. I have a number of single line text items in an application. I set multilineedit false. Fine - the <CR> works as I expect, it doesn't get entered into the text. But <LF> gets put into the value, causing the text already in the text item to scroll up, and hence become invisible. Since this is a single line text item, I don't want to add a scroll bar to get at the previous line(s). Why doesn't the text item ignore all characters that might cause it to become multi-line when not in multilineedit? The solution I use is simple, but shouldn't be necessary (modifyverifycallback checks whether added text contains any character that might cause this, and sets doit to false). Is this a known bug, a "feature", or am I missing something? John. _____ John G. Smith email : hammy@ctt.bellcore.com RRC 1H-213 phone : (201) 699-4530