Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!rutgers!rochester!kodak!tiefel From: tiefel@kodak.UUCP (Lenny Tiefel) Newsgroups: comp.windows.x Subject: simple xlib display Keywords: simple,xlib,display Message-ID: <2359@kodak.UUCP> Date: 21 Feb 90 12:27:14 GMT Organization: Eastman Kodak Co., Rochester, NY Lines: 78 The simple program below should display a hard-wired bitmap, but it doesn't -- only the window frame. Could anyone help? (This is my first xlib program.) Len Tiefel Physics Research Eastman Kodak Company (716) 722-2250 (email tiefel@kodak.com) ----------------------------CUT HERE--------------------------------------- #include #include #include #include /* SMALL BITMAP TO BE PLACED INTO PIXMAP */ /* ------------------------------------- */ #define spicture_width 32 #define spicture_height 32 static char spicture[] = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0}; int main() { Display *dpy; Screen *screen; Window root, win; unsigned long fg, bg; unsigned int depth, screen_number; XEvent event; /* CREATE DISPLAY ON ROOT WINDOW */ /* ----------------------------- */ dpy = XOpenDisplay(NULL); if (dpy == NULL) printf("Dpy is NULL!\n"); screen_number = XDefaultScreen(dpy); screen = XDefaultScreenOfDisplay(dpy); root = XDefaultRootWindow(dpy); i fg = XBlackPixelOfScreen(screen); bg = XWhitePixelOfScreen(screen); depth = XDefaultDepth(dpy,screen_number); win = XCreateSimpleWindow(dpy, root, 200, 200, 400, 400, 1, fg, bg); XCreatePixmapFromBitmapData(dpy, win, spicture, spicture_width, spicture_height, fg, bg, depth); XMapWindow(dpy, win); for (;;) XNextEvent(dpy, &event); }