morreale@bierstadt.scd.ucar.edu (Peter Morreale) (11/13/90)
I'm new to X programming (in fact, this is my first stab..) and I'm
having some trouble getting label/asciiText widget pairs to line up
properly within a form widget.
What I'm shooting for is a bunch of label/asciiText widget pairs within
a single form widget. I can't seem to get the label/text pairs to line
up such that someone could input text. What I want could be represented
by the following:
Name ________ Logon __________
Stuff _________ MoreStuff ____________
(etc...)
Here's a code fragment of what I've been working on:
(note that all I'm trying to do at this point is get a window of
what I want, callbacks will be another nightmare :-)
............
/*
* Create another form and stick a bunch of label/text pairs into it
*/
n = 0;
XtSetArg(arg[n], XtNfromHoriz, View); ++n;
XtSetArg(arg[n], XtNfromVert, cmd[4]); ++n;
XtSetArg(arg[n], XtNresizable, True); ++n;
XtSetArg(arg[n], XtNborderWidth, 3); ++n;
Contacts = XtCreateManagedWidget("contacts", formWidgetClass,
Frm, arg, n);
/* Name of contact */
n=0;
/* XtSetArg(arg[n], XtNfromHoriz, Contacts); ++n;*/
XtSetArg(arg[n], XtNlabel, "Name"); ++n;
cons[0] = XtCreateManagedWidget("name", labelWidgetClass,
Contacts, arg, n);
n = 0;
/*XtSetArg(targ[n], XtNfromHoriz, cons[0]); ++n;*/
XtSetArg(targ[n], XtNeditType, XawtextEdit); ++n;
cons[1] = XtCreateManagedWidget("name", asciiTextWidgetClass,
Contacts, arg, n);
/* Logon of contact */
n=0;
/* XtSetArg(arg[n], XtNfromHoriz, cons[1]); ++n;*/
XtSetArg(arg[n], XtNlabel, "Logon"); ++n;
cons[2] = XtCreateManagedWidget("name", labelWidgetClass,
Contacts, arg, n);
n = 0;
/* XtSetArg(targ[n], XtNfromHoriz, cons[2]); ++n;*/
XtSetArg(targ[n], XtNeditType, XawtextEdit); ++n;
cons[3] = XtCreateManagedWidget("name", asciiTextWidgetClass,
Contacts, arg, n);
...............
What I get seems to be overlapping of the various widgets within the
form. I've tried many variations of the above. (including a stab at
using a dialog instead of the label/text approach.
What is the proper way to go about doing this? If it is a dialog, how
do I get the label to appear directly left of the it's text input?
(note that when finished, there will be on the order of 15 label/text
pairs [ or dialogs] along with another larger text widget)
Thanks for any and all pointers,
-PWM
------------------------------------------------------------------
Peter W. Morreale email: morreale@ncar.ucar.edu
Nat'l Center for Atmos Research voice: (303) 497-1293
Scientific Computing Division
Consulting Office
------------------------------------------------------------------