We've seen this several times before, and as it turns out, even different
implementations of OSF/Motif handle it differently.

-Jon

On Wed, 29 Aug 2001 [EMAIL PROTECTED] wrote:

>Bugs item #456132, was opened at 2001-08-28 06:54
>You can respond by visiting: 
>http://sourceforge.net/tracker/?func=detail&atid=108596&aid=456132&group_id=8596
>
>Category: Xm library
>Group: None
>>Status: Pending
>Resolution: Fixed
>Priority: 5
>Submitted By: John Lemcke (jostle)
>Assigned to: Nobody/Anonymous (nobody)
>Summary: Newlines in XmStrings are ignored
>
>Initial Comment:
>The following statement in Motif creates a button with
>a two line label.
>i.e.
>--------
>| Show |
>|Dialog|
>--------
>
>With LessTif it creates a single line with a graphic
>character instead of the newline.
>i.e.
>-------------
>|Show-Dialog|
>-------------
>
>Widget button = XtVaCreateManagedWidget(
>    "Show\nDialog", xmPushButtonWidgetClass, toplevel,
>NULL);
>
>The Motif Programmers Guide seems to suggest that the
>LessTif version is probably correct. It specifically
>says that XmStringCreateLtoR will interpret embedded
>newlines as breaks but does not say (as far as I could
>see) that XmStringCreateLocalized does not. Motif uses
>XmStringCreateLocalized to create the string in this
>create call.
>
>
>----------------------------------------------------------------------
>
>>Comment By: John Lemcke (jostle)
>Date: 2001-08-29 04:35
>
>Message:
>Logged In: YES 
>user_id=289795
>
>I did a little more testing on this and it seems that the
>difference is actually in the behaviour of
>XmStringCreateLocalized. I have included a small test
>program below.
>I guess the real problem is whether to follow the Motif
>implementation or the documentation (which is not all that
>clear).
>Is there a definitive specification document anywhere?
>-----%<----------------------->%------------
>
>#include <Xm/RowColumn.h>
>#include <Xm/MessageB.h>
>#include <Xm/PushB.h>
>
>int
>main(int argc, char** argv)
>{
>    XtAppContext app;
>
>    Widget toplevel =
>        XtVaOpenApplication(&app, "TestNLs", NULL, 0,
>                            &argc, argv, NULL,
>                            applicationShellWidgetClass,
>                            NULL);
>       
>       // Test the three main XmString creation functions
>
>       // Localized - LessTif renders as a single line with
>embedded
>       // graphic characters. Motif renders as multi line label.
>       // O'Reilly's Motif Programming Manual hints that this
>should be
>       // rendered as a single line but is not specific; which
>would
>       // make the LessTif behaviour correct and Motif wrong!
>       XmString st1 =
>XmStringCreateLocalized("The\nLocalized\nLabel");
>
>       // LtoR - Both render as a multi line label, as documented
>in the
>       // Motif Programming Manual.
>       XmString st2 = XmStringCreateLtoR("The\nLtoR\nLabel",
>                                                                         
>XmFONTLIST_DEFAULT_TAG);
>
>       // Plain - Both render as a single line with embedded
>graphic
>       // characters, as documented in the Motif Programming
>Manual.
>       XmString st3 = XmStringCreate("The\nPlain\nLabel",
>                                                                 
>XmFONTLIST_DEFAULT_TAG);
>
>       Widget rc = XtVaCreateManagedWidget(
>               "rc", xmRowColumnWidgetClass, toplevel,
>               NULL);
>
>    Widget button1 = XtVaCreateManagedWidget(
>        "button1", xmPushButtonWidgetClass, rc,
>               XmNlabelString, st1,
>        NULL);
>    Widget button2 = XtVaCreateManagedWidget(
>        "button2", xmPushButtonWidgetClass, rc,
>               XmNlabelString, st2,
>        NULL);
>    Widget button3 = XtVaCreateManagedWidget(
>        "button3", xmPushButtonWidgetClass, rc,
>               XmNlabelString, st3,
>        NULL);
>
>    XtRealizeWidget(toplevel);
>    XtAppMainLoop(app);
>    return 0;
>}
>
>
>----------------------------------------------------------------------
>
>Comment By: Danny Backx (dannybackx)
>Date: 2001-08-28 11:20
>
>Message:
>Logged In: YES 
>user_id=39146
>
>I've changed the code such that in Motif 2.* versions,
>we do use XmStringCreateLocalized.
>Please test this changed code (Xmos.c version 1.44)
>when you can, and reopen the bug if it doesn't do
>what you expect.
>
>----------------------------------------------------------------------
>
>You can respond by visiting: 
>http://sourceforge.net/tracker/?func=detail&atid=108596&aid=456132&group_id=8596
>
>_______________________________________________
>Lesstif-core mailing list
>[EMAIL PROTECTED]
>http://lists.sourceforge.net/lists/listinfo/lesstif-core
>

--
Dr. Jon A. Christopher           (858) 558-4850, ext 151
Structural GenomiX               [EMAIL PROTECTED]
10505 Roselle St.
San Diego, CA 92121

Reply via email to