I have recently upgraded my development systems from LessTif 0.93.18 to 0.93.41 and noticed a change in treatment of multi-lined text in XmLabel.
Basically, I'm converting strings like "hello\nworld" into an XmString and pass this as XmNlabelString (simple demo program follows at end of message):
* LessTif 0.93.18 and [OSF|Open]Motif 2.1.30 produce an XmLabel that looks as expected:
hello world
* LessTif 0.93.36 and 0.93.41 produce a single line XmLabel
helloXworld
with 'X' either being nothing or a rectangle (an unprintable character, probably). Needless to say, this way of dealing with newlines is detrimental to my GUI design ;-)
Test systems were running Slackware 8.1, FreeBSD 4.6, or W2K with Cygwin.
Any ideas?
- Tony
#include <Xm/Xm.h> #include <Xm/Label.h>
int main(int argc, char *argv[])
{ XtAppContext app_ctxt;
Display *disp;
Widget app_shell;
XmString str;printf("%s\n", XmVERSION_STRING);
XtToolkitInitialize();
app_ctxt = XtCreateApplicationContext();
disp = XtOpenDisplay(app_ctxt, NULL, "Sample", "sample",
NULL, 0, &argc, argv);
app_shell = XtAppCreateShell(NULL, "Sample",
applicationShellWidgetClass,
disp, NULL, 0); str = XmStringGenerate("Hello\nWorld", NULL, XmCHARSET_TEXT, NULL);
/* same effect: str = XmStringCreateLocalized("Hello\nWorld"); */ XtVaCreateManagedWidget("two-line-label", xmLabelWidgetClass,
app_shell, XmNlabelString, str, NULL);XtRealizeWidget(app_shell); XtAppMainLoop(app_ctxt); }
_______________________________________________ Lesstif mailing list [EMAIL PROTECTED] https://terror.hungry.com/mailman/listinfo/lesstif
