test7.c

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

C
63
字号
/* mainw.c -- demonstrate a simple MainWindow by showing * how it can manage a label. */#include <Xm/ScrollBar.h>#include <Xm/Label.h>#include <Xm/MainW.h>intmain(argc, argv)int argc;char *argv[];{    Widget toplevel, mw, hello;    XtAppContext app;    XmString label;    XtSetLanguageProc (NULL, NULL, NULL);    toplevel = XtVaAppInitialize (&app, "Mainw7", NULL, 0,         &argc, argv, NULL, NULL);    /* Create a 500x300 scrolled window.  This value is arbitrary,     * but happens to look good initially.  It is resizable by the user.     */    mw = XtVaCreateManagedWidget ("mainw",          xmMainWindowWidgetClass, toplevel,       /*  xmScrolledWindowWidgetClass, toplevel, */        NULL);    /*    hs = XtVaCreateManagedWidget ("hs",        xmScrollBarWidgetClass, mw,        NULL);    vs = XtVaCreateManagedWidget ("vs",        xmScrollBarWidgetClass, mw,        XmNprocessingDirection,XmMAX_ON_TOP,        NULL); */    label = XmStringCreateLocalized("Hello World!");    hello = XtVaCreateManagedWidget(	   "hellohellohello",            /* arbitrary widget name */	   xmLabelWidgetClass,    /* widget class from Label.h */	   mw,            /* parent widget */	   NULL);              /* terminate varargs list */    /*   XmMainWindowSetAreas(mw,NULL,NULL,NULL,NULL,hello); */    XtRealizeWidget (toplevel);{    static XtWidgetGeometry Expected[] = {   CWWidth | CWHeight            ,  508,  524,   94,   17, 0,0,0, /* mainw */   CWWidth | CWHeight | CWX | CWY,    0,    0,   94,   17, 0,0,0, /* hello */     };    PrintDetails(toplevel,Expected);};  LessTifTestMainLoop(toplevel);    exit(0);}

⌨️ 快捷键说明

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