test14.c
来自「安装DDD之前」· C语言 代码 · 共 62 行
C
62 行
/* **More fault isolation. I get two zeros for width and height using thison the Sun3, but it works fine on the PC.Also, editres "flash active widgets" works fine when used with Athenawidgets on the sun. ** */#include <Xm/Xm.h>#include <Xm/PushB.h>#include <stdio.h>voidcb(Widget w, XtPointer data, XtPointer cbs){ Dimension width, height; Arg args[2]; Cardinal num_args = 0; XtSetArg(args[num_args], XtNwidth, &width); num_args++; XtSetArg(args[num_args], XtNheight, &height); num_args++; XtGetValues(w, args, num_args); printf("width = %d; height = %d\n", width, height);}intmain(int argc, char **argv){ Widget toplevel, one; XtAppContext app; XtSetLanguageProc(NULL, NULL, NULL); toplevel = XtVaAppInitialize(&app, "Label", NULL, 0, &argc, argv, NULL, NULL); one = XtVaCreateManagedWidget("button button", xmPushButtonWidgetClass, toplevel, NULL); XtAddCallback(one, XmNactivateCallback, cb, NULL); XtRealizeWidget(toplevel); { static XtWidgetGeometry Expected[] = { CWWidth | CWHeight, 0, 0, 90, 25, 0,0,0, /* Form */ CWWidth | CWHeight | CWX | CWY, 45, 30, 30, 25, 0,0,0, /* two */}; PrintDetails(toplevel, Expected); } LessTifTestMainLoop(toplevel); /* XtAppMainLoop(app); */ /* NOTREACHED */ exit(0);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?