fontdisplay.c

来自「This source code has been tested under O」· C语言 代码 · 共 49 行

C
49
字号
/*************************************************************************                                                                    ****  fontdisplay.c                                                     ****                                                                    ****  A replacement for the xfd(1X) program, using an XmRowColumn and   ****  lots of labels.                                                   ****                                                                    *************************************************************************/#include <Xm/RowColumn.h>#include <Xm/Label.h>Widget	    appshell,			/* Application Shell	      */	    rowcol,			/* The RowColumn widget       */	    labels[256];		/* The children		      */Arg	    arglist[16];		/* Used to set resources      */int	    lbl_num;                    /* Used to index labels[]     */char        c_str[2];                   /* Used to build labelString  */XmString    lbl_str;                    /* Ditto                      */void main( argc, argv )    int     argc;    char    *argv[];{    appshell = XtInitialize( argv[0], "FontDisplay", NULL, 0, &argc, argv );    rowcol = XmCreateRowColumn( appshell, "RowCol", arglist, 1 );    XtManageChild( rowcol );    c_str[1] = '\0';    for (lbl_num = 0 ;  lbl_num < 256 ;  lbl_num++)        {	c_str[0] = lbl_num;	lbl_str = XmStringCreate( c_str, XmSTRING_DEFAULT_CHARSET );	XtSetArg( arglist[0], XmNlabelString, lbl_str );	labels[lbl_num] = XmCreateLabel( rowcol, "Lbl", arglist, 1 );	XmStringFree( lbl_str );	}    XtManageChildren( labels, 256 );    XtRealizeWidget( appshell );    XtMainLoop();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?