test13.c

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

C
63
字号
/* $Header: /cvsroot/lesstif/lesstif/test/Xm/selectionbox/test13.c,v 1.1 2001/06/18 14:05:31 amai Exp $ *//* picked up from Usenet:   On Linux (Lesstif 0.92 - current version) the program exits, but on   Irix 6.5 it works fine.  Am I missing something simple here?      This is the version for SelectionBox.*/#include <stdlib.h>#include <stdio.h>#include <Xm/Xm.h>#include <Xm/Form.h>#include <Xm/SelectioB.h>#include "../../common/Test.h"intmain (int argc, char *argv[]){  Arg al[1];  int ac;  XtAppContext context;  Widget toplevel, dialog, form, work;  toplevel = XtAppInitialize (&context, "", NULL, 0,			      &argc, argv, NULL, NULL, 0);  dialog = XmCreateSelectionDialog (toplevel, "filesb", NULL, 0);  work=XmSelectionBoxGetChild(dialog, XmDIALOG_WORK_AREA);#if 1  /* try to add one "manually": */  if (!work)    form=XtVaCreateManagedWidget("form", xmFormWidgetClass, dialog,                                 NULL);  work=XmSelectionBoxGetChild(dialog, XmDIALOG_WORK_AREA);#endif    if (!work) {     printf("work==NULL\n");     exit(1);  } else  if (work!=form) {     printf("form != work\n");     exit(2);  } else {     /* Motif 1.2 does so */     printf("form == work\n");  #if 0     XtManageChild(dialog);     XtRealizeWidget (toplevel);     LessTifTestMainLoop (toplevel);#endif     exit(0);  }}

⌨️ 快捷键说明

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