test4.c
来自「安装DDD之前」· C语言 代码 · 共 52 行
C
52 行
#include <stdio.h>#include <Xm/Xm.h>#include <Xm/RowColumn.h>#include <Xm/DrawnB.h>intmain(int argc, char **argv){ XtAppContext theApp; Widget toplevel; Widget butt; Pixmap pixmap; Pixel fg, bg; toplevel = XtVaAppInitialize(&theApp, "test3", NULL, 0, &argc, argv, NULL, NULL); fg = XBlackPixelOfScreen(DefaultScreenOfDisplay(XtDisplay(toplevel))); bg = XWhitePixelOfScreen(DefaultScreenOfDisplay(XtDisplay(toplevel))); pixmap = XmGetPixmap(DefaultScreenOfDisplay(XtDisplay(toplevel)), "xlogo64", fg, bg); if (pixmap == XmUNSPECIFIED_PIXMAP) printf("Pixmap unspecified\n"); butt= XtVaCreateManagedWidget("Button1", xmDrawnButtonWidgetClass, toplevel, XmNwidth, 100, XmNheight, 100, XmNshadowThickness, 4, XmNshadowType, XmSHADOW_ETCHED_OUT, XmNlabelType, XmPIXMAP, XmNlabelPixmap, pixmap, NULL); XtRealizeWidget(toplevel);/* Note: the following values are the result of * querying the current geometry. */{static XtWidgetGeometry Expected[] = { CWWidth | CWHeight , 0, 0, 100, 100, 0,0,0, /* Button1 */};/* toplevel should be replaced with to correct applicationShell */PrintDetails(toplevel, Expected);}LessTifTestMainLoop(toplevel); exit(0);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?