⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test4.c

📁 安装DDD之前
💻 C
字号:
/** test4 -- horizontal column layout of widgets with two columns and XmNadjustLast = False.    resulting layout should be:    button1 button2 button3     button4 button5    the layout shouldn't change upon window resizing.**/#include <Xm/Xm.h>#include <Xm/RowColumn.h>#include <Xm/PushB.h>intmain(int argc, char **argv){    XtAppContext theApp;    Widget toplevel, rc;    Widget button1, button2, button3, button4, button5;    XmString str = XmStringCreateLtoR("This sucker is\nlong and tall",				      XmFONTLIST_DEFAULT_TAG);    toplevel = XtVaAppInitialize(&theApp, "rc-test4", NULL, 0,				 &argc, argv, NULL, NULL);    rc = XtVaCreateManagedWidget("rowcolumn",				 xmRowColumnWidgetClass,				 toplevel,				 XmNorientation, XmHORIZONTAL,				 XmNpacking, XmPACK_COLUMN,				 XmNnumColumns, 2,				 XmNadjustLast, False,				 NULL);    button1 = XtVaCreateManagedWidget("button1",				      xmPushButtonWidgetClass,				      rc,				      NULL);    button2 = XtVaCreateManagedWidget("button2",				      xmPushButtonWidgetClass,				      rc,				      XmNheight, 40, /* this gets ignored */				      NULL);    button3 = XtVaCreateManagedWidget("button3",				      xmPushButtonWidgetClass,				      rc,				      XmNlabelString, str, /* but this doesn't*/				      NULL);    button4 = XtVaCreateManagedWidget("button4",				      xmPushButtonWidgetClass,				      rc,				      NULL);    button5 = XtVaCreateManagedWidget("button5",				      xmPushButtonWidgetClass,				      rc,				      NULL);    XtRealizeWidget(toplevel);  {  static XtWidgetGeometry Expected[] = {  	CWWidth | CWHeight,		0,	0,	300,	85,	0,0,0,  	CWWidth | CWHeight | CWX | CWY,	3,	3,	96,	38,	0,0,0,  	CWWidth | CWHeight | CWX | CWY,	102,	3,	96,	38,	0,0,0,  	CWWidth | CWHeight | CWX | CWY,	201,	3,	96,	38,	0,0,0,  	CWWidth | CWHeight | CWX | CWY,	3,	44,	96,	38,	0,0,0,  	CWWidth | CWHeight | CWX | CWY,	102,	44,	96,	38,	0,0,0,};  PrintDetails(toplevel, Expected);  }    LessTifTestMainLoop(toplevel);    /*    XtAppMainLoop(theApp);        */    exit(0);}

⌨️ 快捷键说明

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