Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!trwind!saturn.ind.trw.com!simpson From: simpson@saturn.ind.trw.com (Scott Simpson) Newsgroups: comp.windows.x Subject: Some O'Reilly Xt Programs Core Dump Message-ID: <3901@trwind.UUCP> Date: 22 Mar 90 01:00:16 GMT Sender: news@trwind.UUCP Reply-To: simpson@saturn.ind.trw.com (Scott Simpson) Organization: TRW Information Networks Division, Torrance, CA Lines: 55 SPARCstation 1, SunOS 4.0.3c, X11 R4 None of the O'Reilly xbitmap programs that come with the X11 R4 distribution work. They all core dump. The reason they core dump is that you need to call BitmapEditGetArrayString with the bitmap widget, not a parent of the bitmap widget. Here are some context diffs for the first bitmap program: *** xbitmap1.c.orig Wed Mar 21 16:48:18 1990 --- xbitmap1.c Wed Mar 21 14:14:22 1990 *************** *** 38,44 **** { int x, y; char *cell; ! cell = BitmapEditGetArrayString(widget); (void) putchar('\n'); for (y = 0; y < pixmap_height_in_cells; y++) { --- 38,44 ---- { int x, y; char *cell; ! cell = BitmapEditGetArrayString(client_data); (void) putchar('\n'); for (y = 0; y < pixmap_height_in_cells; y++) { *************** *** 76,82 **** output = XtCreateManagedWidget("output", commandWidgetClass, buttonbox, NULL, 0); - XtAddCallback(output, XtNcallback, printout, NULL); quit = XtCreateManagedWidget("quit", commandWidgetClass, buttonbox, NULL, 0); --- 76,81 ---- *************** *** 83,88 **** --- 82,89 ---- XtAddCallback(quit, XtNcallback, exit, NULL); bigBitmap = XtCreateManagedWidget("bigBitmap", bitmapEditWidgetClass, form, NULL, 0); + + XtAddCallback(output, XtNcallback, printout, bigBitmap); /* need the following values for the printout routine. */ i = 0; I don't see how this program ever worked, unless the semantics of the bitmap editor widget changed. There are also some other errors in the files in the O'Reilly distribution. For example, the XBitmap2 resource file uses # for comments and xbitmap2.c calls XawScrollBarSetThumb and I have XawScrollbarSetThumb in my Xaw library. The files in this directory need to be tested a little more thoroughly. Scott Simpson TRW Information Networks Division simpson@trwind.trw.com