[comp.windows.x] Dialog widget broken?

net@TUB.BITNET (Oliver Laumann) (01/06/89)

The following program dumps core in XtSetValues.  It works fine when
the label and value resources are not set by calling XtSetValues
explicitly, but by passing the ArgList as an argument to
XtCreateManagedWidget instead.

Is this a bug or a feature?

----------------------------------------------------------------------

#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Dialog.h>

main () $
    Widget top, dia;
    Arg a[2];

    XtSetArg (a[0], XtNlabel, "foo");
    XtSetArg (a[1], XtNvalue, "bar");
    top = XtInitialize ("", "test", (XrmOptionDescRec *)0, 0,
        (Cardinal *)0, (String *)0);
    dia = XtCreateManagedWidget ("dialog", dialogWidgetClass, top,
        (ArgList)0, 0);
    XtSetValues (dia, a, 2);


Regards,
--
Oliver Laumann              net@TUB.BITNET              net@tub.UUCP

swick@ATHENA.MIT.EDU (Ralph R. Swick) (01/07/89)

> The following program dumps core in XtSetValues.

... because there's a stupid typo in Xaw/Dialog.c(SetValues).
(arr[1] instead of arr[0]).