| RE: .0
"not a valid window ID" means that a parameter that you're passing to some Xlib
or Toolkit routine, that is supposed to be a window ID, isn't.
BadDrawable means that a parameter to some Xlib or Toolkit routine that is
supposed to be a drawable, isn't. A "drawable" is X terminology for something
that you can draw into--either a window or a pixmap.
What you need to do is to look at the routine call that is failing and check
all of the parameters that are supposed to be windows or drawables and make
sure you're passing them correctly. Here are some common causes I can think
of for these errors:
- passing the address of the parameter instead of its value, or vice versa
- calling the routine before you've initialized the variable that's supposed to
have the window ID in it
- using XtWindow to get the window ID of a widget before the window is realized
(the window doesn't exist until you realize the widget--before that, XtWindow
returns zero, which isn't a valid window ID)
Since Xlib normally does buffering of X calls, it may not be clear exactly
which X call is failing. You can call XSynchronize() at the front of your
application to cause X to send the calls to the server one at a time, as an
aid to debugging.
--PSW
|