home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / windows / x / 19501 < prev    next >
Encoding:
Text File  |  1992-11-24  |  1.4 KB  |  47 lines

  1. Newsgroups: comp.windows.x
  2. Path: sparky!uunet!mnemosyne.cs.du.edu!nyx!binary
  3. From: binary@nyx.cs.du.edu (binary)
  4. Subject: !! Quick Pixmap Question !!
  5. Message-ID: <1992Nov24.001621.19233@mnemosyne.cs.du.edu>
  6. Sender: usenet@mnemosyne.cs.du.edu (netnews admin account)
  7. Organization: Nyx, Public Access Unix @ U. of Denver Math/CS dept.
  8. Date: Tue, 24 Nov 92 00:16:21 GMT
  9. Lines: 36
  10.  
  11. Here's the deal.  In main(), I'm creating a drawing area widget like:
  12.  
  13.    preview = XtVaCreateManagedWidget("preview",
  14.       xmDrawingAreaWidgetClass, frame,
  15.       NULL);
  16.    XtAddCallback(preview, XmNexposeCallback, draw_preview, NULL);
  17.  
  18. Then, in the callback routine, I'm doing this:
  19.  
  20. void draw_preview(w, client_data, call_data)
  21.    Widget w;
  22.    XtPointer client_data;
  23.    XtPointer call_data;
  24. {
  25.    Pixmap *pix;
  26.    unsigned int *width, *height;
  27.    int xhot, yhot;
  28.    pix = XCreatePixmap(XtDisplay(w), XtWindow(w),
  29.       400, 200, DefaultDepthOfScreen(XtScreen(w)));
  30.    XReadBitmapFile(XtDisplay(w), XtWindow(w),
  31.       "/tmp/preview.xbm", width, height, &pix, &xhot, &yhot);
  32.    XFreePixmap(XtDisplay(w), pix);
  33. }
  34.  
  35. The program compiles correctly, but I always get:
  36.  
  37. [2] + Bus error(coredump)
  38.  
  39. whenever I try to run it.  I've tried everything I can think
  40. of, but the program always chokes on the 'XReadBitmapFile' line.
  41. Any ideas on what could be going wrong here?  I'm clueless.
  42. Thanks for any and all help!
  43.  
  44. :) :) :) :) :)
  45. Mr Binary, SRA, RM
  46.  
  47.