[comp.windows.x] Athena Form widget confusion

dce@smsc.sony.com (David Elliott) (08/16/90)

I have been trying to use an Athena Form widget to set up a simple
text display window.  The original plan was to have a row of buttons,
a label, and a scrolling text area.  The problem I came across was
that the label and text windows don't span the width of the form window.

I have narrowed the problem down some.  The enclosed program puts up a
400x400 window with a label in it, and if an argument (e.g., "foo") is
given to the program, it also puts up a scrollable text area.  Without
an argument, the program works fine.  With an argument, the text area
is fine, but the label isn't wide enough.  In the longer case, adding
2 or 3 buttons above the label makes the text area narrower than the
window.  In all "broken" cases, the right edge acts like it has been
chained right with the offset from the edge increased, not like it
has been set to rubber.

To run the program, set XAPPLRESDIR to "." to get the resources.

#--------------------------Cut Here--------------------------
#! /bin/sh
# This is a shell archive.  Remove anything before the "#! /bin/sh" line,
# then unpack it by saving it in a file and typing "sh file."
#
# Wrapped by David Elliott,,,945-0578 (dce) at icky on Wed Aug 15 17:38:11 1990
#
# unpacks with default permissions
#
# Contents : Imakefile Makefile XTest t.c
#
if test ! -s Imakefile
then
echo "x - Imakefile"
sed 's/^X//' > Imakefile << '@\Rogue\Monster\'
XLOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
X#CDEBUGFLAGS = -g
X
XSRCS = t.c
XOBJS = t.o
X
XComplexProgramTarget(t)
@\Rogue\Monster\
else
  echo "shar: Will not over write Imakefile"
fi
if test ! -s Makefile
then
echo "x - Makefile"
sed 's/^X//' > Makefile << '@\Rogue\Monster\'
X# Makefile generated by imake - do not edit!
X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
X
X###########################################################################
X# Makefile generated from "Imake.tmpl" and </tmp/IIf.000961>
X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
X#
X# Platform-specific parameters may be set in the appropriate .cf
X# configuration files.  Site-wide parameters may be set in the file
X# site.def.  Full rebuilds are recommended if any parameters are changed.
X#
X# If your C preprocessor doesn't define any unique symbols, you'll need
X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
X# "make Makefile", "make Makefiles", or "make World").
X#
X# If you absolutely can't get imake to work, you'll need to set the
X# variables at the top of each Makefile as well as the dependencies at the
X# bottom (makedepend will do this automatically).
X#
X
X###########################################################################
X# platform-specific configuration parameters - edit sony.cf to change
X
X# platform:  $XConsortium: sony.cf,v 1.3 89/07/18 15:39:47 jim Exp $
X# operating system:             NEWS-OS 3.3
X
X###########################################################################
X# site-specific configuration parameters - edit site.def to change
X
X# site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
X
X            SHELL = 	/bin/sh
X
X              TOP = .
X      CURRENT_DIR = .
X
X               AR = ar cq
X  BOOTSTRAPCFLAGS =     -DSYSTYPE_BSD43 -Dsony
X               CC = cc
X
X         COMPRESS = compress
X              CPP = /lib/cpp $(STD_CPP_DEFINES)
X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
X          INSTALL = install
X               LD = ld
X             LINT = lint
X      LINTLIBFLAG = -C
X         LINTOPTS = -axz
X               LN = ln -s
X             MAKE = make
X               MV = mv
X               CP = cp
X           RANLIB = ranlib
X  RANLIBINSTFLAGS =
X               RM = rm -f
X     STD_INCLUDES =
X  STD_CPP_DEFINES =
X      STD_DEFINES = -DKANJI -DSONY_BUGS
X EXTRA_LOAD_FLAGS =
X  EXTRA_LIBRARIES =
X             TAGS = ctags
X
X   SIGNAL_DEFINES = -DSIGNALRETURNSINT
X
X    PROTO_DEFINES =
X
X     INSTPGMFLAGS =
X
X     INSTBINFLAGS = -m 0755
X     INSTUIDFLAGS = -m 4755
X     INSTLIBFLAGS = -m 0664
X     INSTINCFLAGS = -m 0444
X     INSTMANFLAGS = -m 0444
X     INSTDATFLAGS = -m 0444
X    INSTKMEMFLAGS = -g kmem -m 2755
X
X          DESTDIR =
X
X     TOP_INCLUDES = -I$(INCROOT)
X
X      CDEBUGFLAGS = -O
X        CCOPTIONS =
X      COMPATFLAGS =
X
X      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
X   LDCOMBINEFLAGS = -X -r
X
X        MACROFILE = sony.cf
X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
X
X    IMAKE_DEFINES =
X
X         IRULESRC = $(CONFIGDIR)
X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
X
X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
X			$(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
X			$(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
X
X###########################################################################
X# X Window System Build Parameters
X# $XConsortium: Project.tmpl,v 1.68 90/07/03 12:14:47 rws Exp $
X
X###########################################################################
X# X Window System make variables; this need to be coordinated with rules
X# $XConsortium: Project.tmpl,v 1.68 90/07/03 12:14:47 rws Exp $
X
X          PATHSEP = /
X        USRLIBDIR = $(DESTDIR)/usr/lib
X           BINDIR = $(DESTDIR)/usr/bin/X11
X          INCROOT = $(DESTDIR)/usr/include
X     BUILDINCROOT = $(TOP)
X      BUILDINCDIR = $(BUILDINCROOT)/X11
X      BUILDINCTOP = ..
X           INCDIR = $(INCROOT)/X11
X           ADMDIR = $(DESTDIR)/usr/adm
X           LIBDIR = $(USRLIBDIR)/X11
X        CONFIGDIR = $(LIBDIR)/config
X       LINTLIBDIR = $(USRLIBDIR)/lint
X
X          FONTDIR = $(LIBDIR)/fonts
X         XINITDIR = $(LIBDIR)/xinit
X           XDMDIR = $(LIBDIR)/xdm
X           AWMDIR = $(LIBDIR)/awm
X           TWMDIR = $(LIBDIR)/twm
X           GWMDIR = $(LIBDIR)/gwm
X          MANPATH = $(DESTDIR)/usr/man
X    MANSOURCEPATH = $(MANPATH)/man
X           MANDIR = $(MANSOURCEPATH)n
X        LIBMANDIR = $(MANSOURCEPATH)3
X      XAPPLOADDIR = $(LIBDIR)/app-defaults
X
X       FONTCFLAGS = -t
X
X     INSTAPPFLAGS = $(INSTDATFLAGS)
X
X            IMAKE = imake
X           DEPEND = makedepend
X              RGB = rgb
X            FONTC = bdftosnf
X        MKFONTDIR = mkfontdir
X        MKDIRHIER = 	/bin/sh $(BINDIR)/mkdirhier
X
X        CONFIGSRC = $(TOP)/config
X        CLIENTSRC = $(TOP)/clients
X          DEMOSRC = $(TOP)/demos
X           LIBSRC = $(TOP)/lib
X          FONTSRC = $(TOP)/fonts
X       INCLUDESRC = $(TOP)/X11
X        SERVERSRC = $(TOP)/server
X          UTILSRC = $(TOP)/util
X        SCRIPTSRC = $(UTILSRC)/scripts
X       EXAMPLESRC = $(TOP)/examples
X       CONTRIBSRC = $(TOP)/../contrib
X           DOCSRC = $(TOP)/doc
X           RGBSRC = $(TOP)/rgb
X        DEPENDSRC = $(UTILSRC)/makedepend
X         IMAKESRC = $(CONFIGSRC)
X         XAUTHSRC = $(LIBSRC)/Xau
X          XLIBSRC = $(LIBSRC)/X
X           XMUSRC = $(LIBSRC)/Xmu
X       TOOLKITSRC = $(LIBSRC)/Xt
X       AWIDGETSRC = $(LIBSRC)/Xaw
X       OLDXLIBSRC = $(LIBSRC)/oldX
X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
X     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
X     EXTENSIONSRC = $(TOP)/extensions
X
X  DEPEXTENSIONLIB =  $(USRLIBDIR)/libXext.a
X     EXTENSIONLIB = 			  -lXext
X
X          DEPXLIB = $(DEPEXTENSIONLIB)  $(USRLIBDIR)/libX11.a
X             XLIB = $(EXTENSIONLIB) 			  -lX11
X
X      DEPXAUTHLIB =  $(USRLIBDIR)/libXau.a
X         XAUTHLIB = 			  -lXau
X
X        DEPXMULIB =  $(USRLIBDIR)/libXmu.a
X           XMULIB = 			  -lXmu
X
X       DEPOLDXLIB =  $(USRLIBDIR)/liboldX.a
X          OLDXLIB = 			  -loldX
X
X      DEPXTOOLLIB =  $(USRLIBDIR)/libXt.a
X         XTOOLLIB = 			  -lXt
X
X        DEPXAWLIB =  $(USRLIBDIR)/libXaw.a
X           XAWLIB = 			  -lXaw
X
X LINTEXTENSIONLIB =  $(LINTLIBDIR)/llib-lXext.ln
X         LINTXLIB =  $(LINTLIBDIR)/llib-lX11.ln
X          LINTXMU =  $(LINTLIBDIR)/llib-lXmu.ln
X        LINTXTOOL =  $(LINTLIBDIR)/llib-lXt.ln
X          LINTXAW =  $(LINTLIBDIR)/llib-lXaw.ln
X
X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
X
X         DEPLIBS1 = $(DEPLIBS)
X         DEPLIBS2 = $(DEPLIBS)
X         DEPLIBS3 = $(DEPLIBS)
X
X###########################################################################
X# Imake rules for building libraries, programs, scripts, and data files
X# rules:  $XConsortium: Imake.rules,v 1.70 90/05/04 16:57:30 keith Exp $
X
X###########################################################################
X# start of Imakefile
X
XLOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
X#CDEBUGFLAGS = -g
X
XSRCS = t.c
XOBJS = t.o
X
X        PROGRAM = t
X
Xall:: t
X
Xt: $(OBJS) $(DEPLIBS)
X	 $(RM) $@
X	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
X
Xinstall:: t
X	$(INSTALL) -c $(INSTPGMFLAGS)   t $(BINDIR)
X
Xinstall.man:: t.man
X	$(INSTALL) -c $(INSTMANFLAGS) t.man $(MANDIR)/t.n
X
Xdepend::
X	$(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
X
Xlint:
X	$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
Xlint1:
X	$(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
X
Xclean::
X	$(RM) $(PROGRAM)
X
X###########################################################################
X# common rules for all Makefiles - do not edit
X
Xemptyrule::
X
Xclean::
X	$(RM_CMD) \#*
X
XMakefile::
X	-@if [ -f Makefile ]; then \
X		echo "	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
X		$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
X	else exit 0; fi
X	$(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
X
Xtags::
X	$(TAGS) -w *.[ch]
X	$(TAGS) -xw *.[ch] > TAGS
X
X###########################################################################
X# empty rules for directories that do not have SUBDIRS - do not edit
X
Xinstall::
X	@echo "install in $(CURRENT_DIR) done"
X
Xinstall.man::
X	@echo "install.man in $(CURRENT_DIR) done"
X
XMakefiles::
X
Xincludes::
X
X###########################################################################
X# dependencies generated by makedepend
X
X# DO NOT DELETE
X
Xt.o: /usr/include/stdio.h /usr/include/X11/StringDefs.h
Xt.o: /usr/include/X11/Intrinsic.h /usr/include/X11/Xlib.h
Xt.o: /usr/include/sys/types.h /usr/include/X11/X.h /usr/include/X11/Xutil.h
Xt.o: /usr/include/X11/Xresource.h /usr/include/X11/Xos.h
Xt.o: /usr/include/strings.h /usr/include/sys/file.h /usr/include/sys/fcntl.h
Xt.o: /usr/include/sys/time.h /usr/include/sys/time.h /usr/include/X11/Core.h
Xt.o: /usr/include/X11/Composite.h /usr/include/X11/Constraint.h
Xt.o: /usr/include/X11/Object.h /usr/include/X11/RectObj.h
Xt.o: /usr/include/X11/Shell.h /usr/include/X11/Xaw/List.h
Xt.o: /usr/include/X11/Xaw/Simple.h /usr/include/X11/Xmu/Converters.h
Xt.o: /usr/include/X11/Xaw/Viewport.h /usr/include/X11/Xaw/Form.h
Xt.o: /usr/include/X11/Xaw/Reports.h /usr/include/X11/Xaw/AsciiText.h
Xt.o: /usr/include/X11/Xaw/Text.h /usr/include/X11/Xaw/TextI.h
Xt.o: /usr/include/X11/Xaw/TextSink.h /usr/include/X11/Xaw/TextSrc.h
Xt.o: /usr/include/X11/Xaw/AsciiSrc.h /usr/include/X11/Xaw/AsciiSink.h
Xt.o: /usr/include/X11/Xaw/Command.h /usr/include/X11/Xaw/Label.h
@\Rogue\Monster\
else
  echo "shar: Will not over write Makefile"
fi
if test ! -s XTest
then
echo "x - XTest"
sed 's/^X//' > XTest << '@\Rogue\Monster\'
XXTest.width:			400
XXTest.height:			400
X
XXTest.form.width:		400
X
XXTest*label*label:		A Label
XXTest*label*top:		ChainTop
XXTest*label*bottom:		ChainTop
XXTest*label*left:		ChainLeft
XXTest*label*right:		ChainRight
X
XXTest*text*fromVert:		label
XXTest*text*top:			ChainTop
XXTest*text*bottom:		ChainBottom
XXTest*text*left:		ChainLeft
XXTest*text*right:		ChainRight
XXTest*text*scrollVertical:	always
@\Rogue\Monster\
else
  echo "shar: Will not over write XTest"
fi
if test ! -s t.c
then
echo "x - t.c"
sed 's/^X//' > t.c << '@\Rogue\Monster\'
X#include <stdio.h>
X#include <X11/StringDefs.h>
X#include <X11/Intrinsic.h>
X#include <X11/Shell.h>
X#include <X11/Xaw/List.h>
X#include <X11/Xaw/Viewport.h>
X#include <X11/Xaw/AsciiText.h>
X#include <X11/Xaw/Text.h>
X#include <X11/Xaw/Command.h>
X#include <X11/Xaw/Label.h>
X
XWidget Shell, Form, Label, Text;
X
Xmain(argc, argv)
X	int argc;
X	char **argv;
X{
X	Shell = XtInitialize(argv[0], "XTest", NULL, 0, &argc, argv);
X
X	Form = XtCreateManagedWidget("form", formWidgetClass,
X		Shell, NULL, 0);
X
X	Label = XtCreateManagedWidget("label", labelWidgetClass,
X		Form, NULL, 0);
X
X	if (argc > 1) {
X		Text = XtCreateManagedWidget("text", asciiTextWidgetClass,
X			Form, NULL, 0);
X	}
X
X	XtRealizeWidget(Shell);
X	XtMainLoop();
X}
@\Rogue\Monster\
else
  echo "shar: Will not over write t.c"
fi
# to concatenate archives, remove anything after this line
exit 0