home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!mnemosyne.cs.du.edu!nyx!binary
- From: binary@nyx.cs.du.edu (binary)
- Subject: !! Quick Pixmap Question !!
- Message-ID: <1992Nov24.001621.19233@mnemosyne.cs.du.edu>
- Sender: usenet@mnemosyne.cs.du.edu (netnews admin account)
- Organization: Nyx, Public Access Unix @ U. of Denver Math/CS dept.
- Date: Tue, 24 Nov 92 00:16:21 GMT
- Lines: 36
-
- Here's the deal. In main(), I'm creating a drawing area widget like:
-
- preview = XtVaCreateManagedWidget("preview",
- xmDrawingAreaWidgetClass, frame,
- NULL);
- XtAddCallback(preview, XmNexposeCallback, draw_preview, NULL);
-
- Then, in the callback routine, I'm doing this:
-
- void draw_preview(w, client_data, call_data)
- Widget w;
- XtPointer client_data;
- XtPointer call_data;
- {
- Pixmap *pix;
- unsigned int *width, *height;
- int xhot, yhot;
- pix = XCreatePixmap(XtDisplay(w), XtWindow(w),
- 400, 200, DefaultDepthOfScreen(XtScreen(w)));
- XReadBitmapFile(XtDisplay(w), XtWindow(w),
- "/tmp/preview.xbm", width, height, &pix, &xhot, &yhot);
- XFreePixmap(XtDisplay(w), pix);
- }
-
- The program compiles correctly, but I always get:
-
- [2] + Bus error(coredump)
-
- whenever I try to run it. I've tried everything I can think
- of, but the program always chokes on the 'XReadBitmapFile' line.
- Any ideas on what could be going wrong here? I'm clueless.
- Thanks for any and all help!
-
- :) :) :) :) :)
- Mr Binary, SRA, RM
-
-