[comp.windows.x] XCreateWindow

grady@fxgrp (Steven Grady) (02/25/89)

There seems to be an omission in the documentation for XCreateWindow().
It appears (from looking at the source) that you will get a BadMatch
error if you specify a visual different from the parent, but don't
supply a colormap in the window attributes structure.  I guess this
makes sense, but it certainly isn't documented.  (It's not mentioned
in the O'Reilly books either.)

I just got hold of a server that supports multiple visuals, so I suspect
I will find more problems along these lines in the near future..

	Steven
	...!ucbvax!grady
	grady@postgres.berkeley.edu

"The good thing about drawing a tiger is that it automatically
makes your picture fine art."

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (02/26/89)

This is documented in the second paragraph of Section 3.2.9 of the
Xlib manual (page 39 in the Digital Press book).

krupczak@secola.Columbia.NCR.COM (Bobby Krupczak) (10/04/90)

Hi!

When I try to create a window of depth 1 with XCreateWindow(), it
bombs with the X Protocol Error -- Bad Match.  My default screen
depth is 4 (the default is 4 and everything else is too).

The XLIB manual says that the depth argument need not be equal to the
parent's depth.  Does this mean that there is a bug in my XLIB
code, or am I doing something wrong?

Thanks for the help . . .

Bobby

klee@wsl.dec.com (Ken Lee) (10/05/90)

In article <611@secola.Columbia.NCR.COM>, krupczak@secola.Columbia.NCR.COM (Bobby Krupczak) writes:
|> When I try to create a window of depth 1 with XCreateWindow(), it
|> bombs with the X Protocol Error -- Bad Match.  My default screen
|> depth is 4 (the default is 4 and everything else is too).
|> 
|> The XLIB manual says that the depth argument need not be equal to the
|> parent's depth.  Does this mean that there is a bug in my XLIB
|> code, or am I doing something wrong?

No, the depth need not be the same as that of the parent, but it does
have to be one supported by the visual you're using.  Notice that the
10th argument to XCreateWindow is the visual.  You can use
XMatchVisualInfo() to find a visual with the depth you want.  Your
server/hardware may not support any visuals with depths other than 4.

-- 
Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@wsl.dec.com
uucp: uunet!decwrl!klee