Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!arisia!jlevy From: jlevy@arisia.Xerox.COM (Jacob Levy) Newsgroups: comp.windows.x Subject: Small HP widget program that doesn't work Summary: XtGetValues returns garbage?? Message-ID: <665@arisia.Xerox.COM> Date: 31 Mar 89 19:48:16 GMT Reply-To: jlevy.pa@xerox.com (Jacob Levy) Organization: Xerox PARC Lines: 110 Hi, I grabbed the Xw stuff from ai.toronto.edu and have it up and running on Sun 3's and 4's. It's great, except that XtGetValues doesn't seem to do the right thing for these widgets. Here is an example program and run (on a Sun 3/260, 3.5, with X11R3+purdue2): Script started on Fri Mar 31 11:33:08 1989 spock:/herbrand/jlevy/xdev <1> cat test.c #include #include #include #include #include #include /* * Xt Intrinsic includes */ #include #include /* * Inherited stuff from Athena widgets */ #include #include /* * HP X Widgets includes */ #include #include long numargs; Arg args[256]; #define StartArgs numargs = 0 #define MakeArg(n, v){ args[numargs].name = n; \ args[numargs].value = (XtArgVal)(v);\ numargs++; \ } selected(w, a, d) Widget w; caddr_t a; caddr_t d; { long x1, x2, x3, x4, x5; StartArgs; MakeArg(XtNx, &x1); MakeArg(XtNy, &x2); MakeArg(XtNwidth, &x3); MakeArg(XtNheight, &x4); MakeArg(XtNborderWidth, &x5); XtGetValues(w, args, numargs); printf("widget %d has geometry %dx%d+%dx%dx%d\n", w, x1, x2, x3, x4, x5); exit(0); } static XtCallbackRec callbackList[] = { {(XtCallbackProc)selected, NULL}, {NULL, NULL} }; main(ac, av) char **av; { Widget top; Widget p1; top = XtInitialize("test", "Test", NULL, NULL, &ac, av); StartArgs; MakeArg(XtNallowShellResize, True); XtSetValues(top, args, numargs); StartArgs; MakeArg(XtNx, 300); MakeArg(XtNy, 300); MakeArg(XtNwidth, 300); MakeArg(XtNheight, 300); MakeArg(XtNselect, callbackList); p1 = XtCreateManagedWidget("pbutton", XwpushButtonWidgetClass, top, args, numargs); XtRealizeWidget(top); XtMainLoop(); } spock:/herbrand/jlevy/xdev <2> cc -o test test.c -lXw -lXt -lXmu -lX11 spock:/herbrand/jlevy/xdev <3> test widget 392880 has geometry 0x42392+19670440x19723920x40992 spock:/herbrand/jlevy/xdev <3> script done on Fri Mar 31 11:33:25 1989 Does anyone know what's wrong? Has anyone encountered this problem at all? Do you know where to send bug reports to for Xw widgets? Any help appreciated. Thanks, --Jacob