erm, this ones been killing me for the last few days: does anyone know how to get a pixmap to be displayed as a background to a window? (whenever i try to do it, it just errors out, some BadMatch error in XCreateWindow ), when i try to copy the pixmap to the window (XCopyPlane) it doesn't display anything (at least not a pixmap i told it to draw)
heres the code I'm using to draw the pixmap
Code:
Pixmap exitpic;
switch (XReadBitmapFile (display, win, "/home/ME/pixmap", &rw, &rh, &exitpic, &rhx, &rhy)) {
case BitmapSuccess:
fprintf (stderr, "bitmap in place");
break;
case BitmapOpenFailed:
fprintf(stderr, "XReadBitmapFile - could not open file 'icon.bmp'.\n");
break;
case BitmapFileInvalid:
fprintf(stderr,
"XReadBitmapFile - file doesn't contain a valid bitmap.\n");
break;
case BitmapNoMemory:
fprintf(stderr, "XReadBitmapFile - not enough memory.\n");
break;
}
switch (XCopyPlane (display, exitpic, testwin, gc, 0, 0, 20, 20, 0, 0, 1)) {
case BadDrawable:
fprintf (stderr, "drawable");
break;
case BadGC:
fprintf (stderr, "gc");
break;
case BadMatch:
fprintf (stderr, "match");
break;
case BadValue:
fprintf (stderr, "value");
break;
default:
fprintf (stderr, "hi");
break;
}
XFlush(display);
anyways.. heres the part i use when i tried to get it to display as a background (just the needed parts, the rest is the same as at top)
Code:
XSetWindowAttributes swmatt;
swmatt.background_pixmap = exitpic;
Window testwin = XCreateWindow (display, parentwin, 3, 72, 20, 20, 1, CopyFromParent, InputOutput, CopyFromParent, CWBorderPixel|CWEventMask|CWBackPixmap, &swmatt);
anyone here know how to get pixmaps to properly display? (i looked thru every tutorial for Xlibs i could find, none i found showed fully how to get a pixmap to display (at least for the background), and nothing in anything i found helped out so far