📄 listing_5_6.c
字号:
/************************************************************************* **** listing_5_6.c **** **** This program demonstrates programmatic setting of an XmLabel's **** labelString resource. Along the way it demonstrates use of the **** XmString data type, including the use of multiple fonts. **** *************************************************************************/#include <Xm/Label.h> /* Definitions for XmLabel (includes Xm.h) */Widget appshell, /* Application Shell */ the_label; /* The one and only label */Arg arglist[16]; /* Used to store label */XmString str1, /* Strings for the label */ str2, the_string;void main( argc, argv ) int argc; char *argv[];{ appshell = XtInitialize( argv[0], "Listing_5_6", NULL, 0, &argc, argv ); the_label = XmCreateLabel( appshell, "TheLabel", NULL, 0 ); XtManageChild( the_label ); str1 = XmStringCreateLtoR( "Hello\n", XmSTRING_DEFAULT_CHARSET ); str2 = XmStringCreate( "World!", "CharSet1" ); the_string = XmStringConcat( str1, str2 ); XmStringFree( str1 ); XmStringFree( str2 ); XtSetArg( arglist[0], XmNlabelString, the_string ); XtSetValues( the_label, arglist, 1 ); XmStringFree( the_string ); XtRealizeWidget( appshell ); XtMainLoop();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -