Page:Xlib - C Language X Interface.pdf/45

 {| style="background:#F0F0F0;color: #202122;" cellpadding=10px
 * colspan=2 |
 * - valign=top
 * display || Specifies the connection to the X server.
 * - valign=top
 * parent || Specifies the parent window.
 * - valign=top
 * x
 * - valign=top
 * y || Specify the x and y coordinates, which are the top-left outside corner of the created window's borders and are relative to the inside of the parent window's borders.
 * - valign=top
 * width ||
 * - valign=top
 * height || Specify the width and height, which are the created window's inside dimensions and do not include the created window's borders. The dimensions must be nonzero, or a BadValue error results.
 * - valign=top
 * border_width || Specifies the width of the created window's border in pixels.
 * - valign=top
 * depth || Specifies the window's depth. A depth of CopyFromParent means the depth is taken from the parent.
 * - valign=top
 * class || Specifies the created window's class. You can pass InputOutput, InputOnly, or CopyFromParent. A class of CopyFromParent means the class is taken from the parent.
 * - valign=top
 * visual || Specifies the visual type. A visual of CopyFromParent means the visual type is taken from the parent.
 * - valign=top
 * valuemask || Specifies which window attributes are defined in the attributes argument. This mask is the bitwise inclusive OR of the valid attribute mask bits. If valuemask is zero, the attributes are ignored and are not referenced.
 * - valign=top
 * attributes || Specifies the structure from which the values (as specified by the value mask) are to be taken. The value mask should have the appropriate bits set to indicate which attributes have been set in the structure.
 * }
 * }

The XCreateWindow function creates an unmapped subwindow for a specified parent window, returns the window ID of the created window, and causes the X server to generate a CreateNotify event. The created window is placed on top in the stacking order with respect to siblings.

The coordinate system has the X axis horizontal and the Y axis vertical with the origin [0, 0] at the upper-left corner. Coordinates are integral, in terms of pixels, and coincide with pixel centers. Each window and pixmap has its own coordinate system. For a window, the origin is inside the border at the inside, upper-left corner.

The border_width for an InputOnly window must be zero, or a BadMatch error results. For class InputOutput, the visual type and depth must be a combination supported for the screen, or