test3.c

来自「安装DDD之前」· C语言 代码 · 共 54 行

C
54
字号
#include <Xm/Xm.h>#include <Xm/PushB.h>Display *theDisplay;Window theRootWindow;Pixmap Pix;Widget toplevel;intmain(int argc, char **argv){  XtAppContext theApp;  Widget label;  Pixel fg,bg;    toplevel = XtVaAppInitialize(&theApp, "drawingArea", NULL, 0,			       &argc, argv, NULL, NULL);  label= XtVaCreateManagedWidget("Button1",                                  xmPushButtonWidgetClass, toplevel, 				 NULL);  XtRealizeWidget(toplevel);  theDisplay = XtDisplay(toplevel);  theRootWindow = XDefaultRootWindow(theDisplay);  fg = XBlackPixelOfScreen(DefaultScreenOfDisplay(theDisplay));  bg = XWhitePixelOfScreen(DefaultScreenOfDisplay(theDisplay));  Pix = XmGetPixmap(DefaultScreenOfDisplay(theDisplay),                    "xlogo64",                    fg, bg);  XtVaSetValues(label,	        XmNlabelPixmap,Pix,                 XmNlabelType,XmPIXMAP,                NULL);  {  static XtWidgetGeometry Expected[] = {  	CWWidth | CWHeight,		0,	0,	54,	25,	0,0,0,	/* Form */  	CWWidth | CWHeight | CWX | CWY,	45,	30,	30,	25,	0,0,0,	/* two */};  PrintDetails(toplevel, Expected);  }  LessTifTestMainLoop(toplevel);  /*  XtAppMainLoop(theApp);  */  exit(0);}

⌨️ 快捷键说明

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