[comp.windows.x] XtSetArg bug

duanev@kauai.ACA.MCC.COM (Duane Voth) (03/14/89)

Well this is a goofy one.  The following doesn't work:
(X11R3 no less; and with a List widget)

	Arg arg;

	XtSetArg(arg, XtNcallback, callrec);
	XtSetValues(widget, arg, ONE);

Seems to segviol down in XtSetValues.  The work around is:

	Arg arg[1];

	XtSetArg(arg[0], XtNcallback, callrec);
	XtSetValues(widget, arg, ONE);

Some artifact of the XtSetArg macro no doubt.  Yuck.
(I'm Mailing to xbugs too)

duane
-- 
--- Effectiveness is the measure of Truth:
----            ALL systems are arbitrary!
--- duane voth              duanev@mcc.com
--

kit@ATHENA.MIT.EDU (Chris D. Peterson) (03/14/89)

> Well this is a goofy one.  The following doesn't work:
> (X11R3 no less; and with a List widget)

>	Arg arg;

> 	XtSetArg(arg, XtNcallback, callrec);
> 	XtSetValues(widget, arg, ONE);

Try this:

 	XtSetValues(widget, &arg, ONE);

			    ^
			    |

> Some artifact of the XtSetArg macro no doubt.  Yuck.
> (I'm Mailing to xbugs too)

Don't, this is not a bug.


						Chris D. Peterson     
						MIT X Consortium /
						Project Athena 

Net:	kit@athena.mit.edu		
Phone: (617) 253 - 1326			
USMail: MIT - Room E40-321
	77 Massachusetts Ave.		
	Cambridge, MA 02139		

mike@cosmos.acs.calpoly.edu (Mike Patnode) (03/15/89)

In article <118@kauai.ACA.MCC.COM> duanev@kauai.ACA.MCC.COM (Duane Voth) writes:
>
>	Arg arg;
>
>	XtSetArg(arg, XtNcallback, callrec);
>	XtSetValues(widget, arg, ONE);
			    ^^^^This is an arg variable instance.
>
>Seems to segviol down in XtSetValues.  The work around is:
>
>	Arg arg[1];
>
>	XtSetArg(arg[0], XtNcallback, callrec);
>	XtSetValues(widget, arg, ONE);
			    ^^^^This is an arg pointer.
Try
	XtSetValues(widget, &arg, ONE);
in the first case.

	Arg arg[1];
	   and
	Arg arg;
are not the same thing.  You'll probably get flamed to death about this.

>(I'm Mailing to xbugs too)
Oops, you'll probably wan't to rmmailq on that one.
----
Mike "Dodger" Patnode          |       mike@cosmos.ACS.CalPoly.EDU
Yitbos Innovations Inc.        |                  or              	
244 California Blvd            |       mpatnode@polyslo.CalPoly.EDU
San Luis Obispo, Ca  92630     | (805) 541-2048 / 543-9818 / 756-2516