⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list_16_24.c

📁 This source code has been tested under OpenWindows 2.0, Sun s X11/NeWS server. For Xlib programs th
💻 C
字号:
/*************************************************************************                                                                    ****  listing_16_24.c                                                   ****                                                                    ****  Application Resource example. This program provides a "debugOn"   ****  resource, which may be set to TRUE to enable runtime logging.     ****                                                                    *************************************************************************/#include <Xm/Label.h>Widget	    appshell,	    the_label;struct	    ResList			/* The application resources  */	    {		    Boolean	db_flag;	/*   "debugOn"                */            }	    app_resources,	    def_resources = { FALSE };XtResource  app_res_list[] =	    {		{ 		"debugOn", 		"DebugOn", 		XmRBoolean,		sizeof(app_resources.db_flag),		XtOffset(struct ResList *, db_flag), 		XmRBoolean, 		&def_resources.db_flag		}	    };void main( argc, argv )    int     argc;    char    *argv[];{    appshell = XtInitialize( argv[0], "Listing_16_24", NULL, 0, &argc, argv );    XtGetApplicationResources( appshell, &app_resources,			       app_res_list, XtNumber(app_res_list),			       NULL, 0 );    the_label = XmCreateLabel( appshell, "TheLabel", NULL, 0 );    XtManageChild( the_label );if (app_resources.db_flag)	{	if (the_label == NULL)	    printf( "Debug: Creation of \"TheLabel\" failed\n" );        else	    printf( "Debug: \"TheLabel\" created, ID = %d\n", the_label );	}    XtRealizeWidget( appshell );if (app_resources.db_flag)	printf( "Debug: XtRealize called\n" );    XtMainLoop();}

⌨️ 快捷键说明

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