📄 listing_9_11.c
字号:
/************************************************************************* **** listing_9_11.c **** **** Demonstration of XmText as used for entry fields. Both single- **** line and multi-line fields are presented, for an address card **** entry form. In addition, this program demonstrates the use of **** compiled-in translations. **** *************************************************************************/#include <Xm/BulletinB.h>#include <Xm/Label.h>#include <Xm/Text.h>Widget appshell, /* Application Shell */ the_bb, /* The parent */ labels[3], /* Labels for the fields */ fields[3]; /* The entry fields */Arg arglist[1]; /* Used to set unitType */XtTranslations ttab; /* Used to augment field 1 */void main( argc, argv ) int argc; char *argv[];{ appshell = XtInitialize( argv[0], "Listing_9_11", NULL, 0, &argc, argv ); XtSetArg( arglist[0], XmNunitType, Xm100TH_POINTS ); the_bb = XmCreateBulletinBoard( appshell, "TheBB", arglist, 1 ); XtManageChild( the_bb ); labels[0] = XmCreateLabel( the_bb, "Name_Lbl", NULL, 0 ); labels[1] = XmCreateLabel( the_bb, "Addr_Lbl", NULL, 0 ); labels[2] = XmCreateLabel( the_bb, "Phon_Lbl", NULL, 0 ); XtManageChildren( labels, 3 ); fields[0] = XmCreateText( the_bb, "Name_Txt", NULL, 0 ); fields[1] = XmCreateText( the_bb, "Addr_Txt", NULL, 0 ); fields[2] = XmCreateText( the_bb, "Phon_Txt", NULL, 0 ); XtManageChildren( fields, 3 ); XmAddTabGroup( fields[0] ); XmAddTabGroup( fields[1] ); XmAddTabGroup( fields[2] ); ttab = XtParseTranslationTable( "None<Key>Tab: next-tab-group()" ); XtOverrideTranslations( fields[1], ttab ); XtRealizeWidget( appshell ); XtMainLoop();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -