Problem with Motif form widget in SCO-ODT

Don R. Lyons x4811 lyons at cdss.UUCP
Sat Jul 7 05:02:32 AEST 1990


Can anyone tell me why the form widget does not size to fit
button1, button2, button3 under SCO-ODT? When this application is
displayed only button1 and button2 are visible. All three are visible
if don't set XmNbottomAttachment for wbutton[2]. Please email me, I
have a product deadline I am trying to meet.

thanx
  -don


	#include <X11/Intrinsic.h>
	#include <Xm/Xm.h>
	#include <Xm/Form.h>
	#include <Xm/PushB.h>
	
	char *buttons[] = { "button1", "button2", "button3" };
	
	void main( argc, argv)
	int argc;
	char **argv;
	{
	  Widget toplevel, form, wbutton[5];
	  int i, n;
	  Arg wargs[10];
	
	  toplevel = XtInitialize( argv[0], "Formtest", NULL, 0, &argc, argv);
	
	  form = XtCreateManagedWidget( "form", xmFormWidgetClass, toplevel,
						NULL, 0);
	
	  for ( i = 0; i < XtNumber(buttons); i++)
	    wbutton[i] = XtCreateWidget( buttons[i],
	   			 xmPushButtonWidgetClass, form, NULL, 0);
	  XtManageChildren( wbutton, XtNumber(buttons));
	
	  n = 0;
	  XtSetArg(wargs[n], XmNtopAttachment,   XmATTACH_FORM); n++;
	  XtSetArg(wargs[n], XmNleftAttachment,  XmATTACH_FORM); n++;
	  XtSetArg(wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
	  XtSetValues(wbutton[0], wargs, n);
	  n = 0;
	  XtSetArg(wargs[n], XmNtopAttachment,   XmATTACH_WIDGET);n++;
	  XtSetArg(wargs[n], XmNtopWidget,       wbutton[0]);     n++;
	  XtSetArg(wargs[n], XmNleftAttachment,  XmATTACH_FORM);  n++;
	  XtSetArg(wargs[n], XmNrightAttachment, XmATTACH_FORM);  n++;
	  XtSetValues(wbutton[1], wargs, n);
	  n = 0;
	  XtSetArg(wargs[n], XmNtopAttachment,   XmATTACH_WIDGET);n++;
	  XtSetArg(wargs[n], XmNtopWidget,       wbutton[1]);     n++;
	  XtSetArg(wargs[n], XmNleftAttachment,  XmATTACH_FORM);  n++;
	  XtSetArg(wargs[n], XmNrightAttachment, XmATTACH_FORM);  n++;
	  XtSetArg(wargs[n], XmNbottomAttachment,XmATTACH_FORM);  n++;
	  XtSetValues(wbutton[2], wargs, n);
	
	  XtRealizeWidget(toplevel);
	  XtMainLoop();
	}
-- 
Don R Lyons                          Any opinions expressed are my own.
Arinc Research Inc                      uucp : uunet!cdss!lyons
CDSS, Mail Stop 1249                    voice: 301 266 4811
2551 Riva Road Annapolis , MD 21401     fax  : 301 266 2047



More information about the Comp.unix.i386 mailing list