Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!wsl.dec.com!klee From: klee@wsl.dec.com (Ken Lee) Newsgroups: comp.windows.x Subject: Re: XGetImage, BadMatch Message-ID: <1991Apr17.112248@wsl.dec.com> Date: 17 Apr 91 18:22:48 GMT References: <1991Apr17.022705.14758@odin.corp.sgi.com> Sender: news@pa.dec.com (News) Reply-To: klee@wsl.dec.com Organization: DEC Western Software Laboratory Lines: 16 In article <1991Apr17.022705.14758@odin.corp.sgi.com>, hajadi@goofy.csd.sgi.com (Ivan Hajadi) writes: |> I copied the reflect_window program from Vol 1 O`Reilly book, and |> tried to run it. I keep getting BadMatch error. Anyone knows |> what's wrong with this program ? This code commits the most basic error of X programming. It creates and maps a window then tries to use it (XGetImage) without waiting for an expose or map event. Since mapping is done by the window manager, it is sometimes delayed. The Xlib manual says you will get a BadMatch if you do an XGetImage on an unmapped window, which is probably your problem. -- Ken Lee DEC Western Software Laboratory, Palo Alto, Calif. Internet: klee@wsl.dec.com uucp: uunet!decwrl!klee