📄 list_16_24.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 + -