Path: utzoo!attcan!uunet!snorkelwacker!bloom-beacon!CS.WISC.EDU!dcmartin From: dcmartin@CS.WISC.EDU ("David C. Martin") Newsgroups: comp.windows.x Subject: problems using XSetWMHints().. Message-ID: <8912010703.AA00762@cheddar.cs.wisc.edu> Date: 1 Dec 89 07:02:57 GMT Sender: dcmartin@cs.wisc.edu Organization: University of Wisconsin - Madison Lines: 44 I am attempting to write a short program to set the pixmap for an xterm window. It doesn't seem to modify the hints. Any ideas? dcm ------- #include #include #include #include extern XWMHints* XGetWMHints(); main(argc, argv) int argc; char** argv; { Display* display = XOpenDisplay(getenv("DISPLAY")); Window window = atoi(getenv("WINDOWID")); int screen = DefaultScreen(display); Window rw = RootWindow(display, screen); XWMHints* hints = (XWMHints*) NULL; int x, y, w, h; Pixmap bitmap; char* fn = (char*) NULL; if (argc == 2) { fn = argv[1]; if ((hints = XGetWMHints(display, window)) != (XWMHints*) NULL) { int status; hints->flags |= IconPixmapHint; status = XReadBitmapFile(display, rw, fn, &w, &h, &bitmap, &x, &y); if (status == BitmapSuccess) { hints->icon_pixmap = bitmap; status = XSetWMHints(display, window, hints); XFree(hints); if (status != BadAlloc && status != BadWindow) { exit(0); } } } } exit(1); }