1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
/*
* Motif
*
* Copyright (c) 1987-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$XConsortium: RowCol5.c /main/6 1995/07/13 18:33:55 drk $"
#endif
#endif
/******************************************************************************
*
*
* (c) Copyright 1987, 1988, 1989 HEWLETT-PACKARD COMPANY */
#include <testlib.h>
#define MAXKID 10
Widget BBoard;
Widget RowColumn;
Widget Kid[MAXKID], newKid1, newKid2;
static void CreateRowColumn();
void main(argc, argv)
int argc;
char **argv;
{
register int n;
register int i;
Arg args[MAX_ARGS];
char label[80];
CommonTestInit(argc, argv);
CreateRowColumn(Shell1);
XtRealizeWidget(Shell1);
CommonPause();
n = 0;
XtSetArg(args[n], XmNpositionIndex, XmLAST_POSITION); n++;
for (i = MAXKID - 2; i >= 0; i--)
XtSetValues(Kid[i], args, n);
CommonPause();
n = 0;
XtSetArg(args[n], XmNpositionIndex, 3); n++;
newKid1 = XmCreatePushButton(RowColumn, "NewKid1", args, n);
n = 0;
XtSetArg(args[n], XmNpositionIndex, 9); n++;
newKid2 = XmCreatePushButton(RowColumn, "NewKid2", args, n);
CommonPause();
n = 0;
XtSetArg(args[n], XmNpositionIndex, 0); n++;
XtSetValues(newKid1, args, n);
n = 0;
XtSetArg(args[n], XmNpositionIndex, 1); n++;
XtSetValues(newKid2, args, n);
n = 0;
XtSetArg(args[n], XmNpositionIndex, XmLAST_POSITION); n++;
XtSetValues(Kid[5], args, n);
CommonPause();
XtDestroyWidget(RowColumn);
CommonPause();
XtAppMainLoop(app_context);
}
static void CreateRowColumn(Widget Shell1)
{
register int i;
register int n;
Arg args[MAX_ARGS];
char label[80];
n = 0;
XtSetArg(args[n], XmNdefaultPosition, False); n++;
BBoard = XmCreateBulletinBoardDialog(Shell1, "RowCol3", args, n);
n = 0;
XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;
XtSetArg(args[n], XmNnumColumns, 30); n++;
XtSetArg (args[n], XmNtraversalOn, True); n++;
RowColumn = XmCreateRowColumn(BBoard, "RowColumn", args, n);
n = 0;
for (i = 0; i < MAXKID; i++) {
sprintf(label, "Child%d", i);
Kid[i] = XmCreatePushButton(RowColumn, label, args, n);
}
XtManageChildren(Kid, MAXKID);
XtManageChild(RowColumn);
XtManageChild(BBoard);
}
|