📄 test13.c
字号:
/* $Header: /cvsroot/lesstif/lesstif/test/Xm/label/test13.c,v 1.4 2001/05/15 13:40:54 amai Exp $ *//*From: "Edward A. Falk" <falconer@best.com>To: lesstif@lesstif.orgSubject: Lesstif 0.89-9 bug: string resource converterDate: Fri, 3 Mar 2000 15:33:23 -0800 (PST)Hello; this is a bug report on a minor bug I've encounteredin Motif string handling. I think it's in the String-to-XmStringresource converter.The following program creates a label widget. The resourcesfile looks like this: *multiLbl.labelString: Multi\n\ line\n\ labelUnder Motif, the label looks like this: +---------+ | Multi | | line| | label| +---------+Under Lesstif, the label looks like this: +---------+ | Multi | |NN line| |NN label| +---------+Where 'N' is actually a funky "NL" graphic from the default font.Program follows:*//* Show bug in resource converter; the String => XmString converter is * not handling newlines or leading spaces correctly. Compile this same * program under Motif to see the difference. */#include <stdlib.h>#include <stdio.h>#include <Xm/Label.h>static XtAppContext app_ctx ;static Widget topLevel ;static char *FallBack[] = { "*multiLbl.labelString: Multi\\n\ line\\n\ label", NULL};intmain(int argc, char **argv){ XtSetLanguageProc(NULL,NULL,NULL) ; topLevel = XtVaAppInitialize(&app_ctx, "Stringbug", NULL,0, &argc,argv, FallBack,NULL) ; XtCreateManagedWidget("multiLbl", xmLabelWidgetClass, topLevel,NULL,0); XtRealizeWidget(topLevel) ;/* Note: the following values are the result of * querying the current geometry. */{static XtWidgetGeometry Expected[] = { CWWidth | CWHeight , 0, 0, 166, 43, 0,0,0, /* multiLbl */};/* toplevel should be replaced with to correct applicationShell */PrintDetails(topLevel, Expected);}LessTifTestMainLoop(topLevel); /* XtAppMainLoop(app_ctx) ; */ exit(0) ;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -