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 _I_n_p_u_t_O_n_l_y window must be zero, or a _B_a_d_M_a_t_c_h error results. For class _I_n_p_u_t_O_u_t_p_u_t, the visual type and depth must be a combination supported for the screen, or a _B_a_d_M_a_t_c_h error results. The depth need not be the same as the parent, but the parent must not be a window of class _I_n_p_u_t_O_n_l_y, or a _B_a_d_M_a_t_c_h error results. For an _I_n_p_u_t_O_n_l_y window, the depth must be zero, and the visual must be one supported by the screen. If either condition is not met, a _B_a_d_M_a_t_c_h error results. The parent window, however, may have any depth and class. If you specify any invalid window attribute for a window, a _B_a_d_M_a_t_c_h error results.
The created window is not yet displayed (mapped) on the user's display. To display the window, call _X_M_a_p_W_i_n_d_o_w. The new window initially uses the same cursor as its parent. A new cursor can be defined for the new window by calling _X_D_e_f_i_n_e_C_u_r_s_o_r. The window will not be visible on the screen unless it and all of its ancestors are mapped and it is not obscured by any of its ancestors.
_X_C_r_e_a_t_e_W_i_n_d_o_w can generate _B_a_d_A_l_l_o_c _B_a_d_C_o_l_o_r, _B_a_d_C_u_r_s_o_r, _B_a_d_M_a_t_c_h, _B_a_d_P_i_x_m_a_p, _B_a_d_V_a_l_u_e, and _B_a_d_W_i_n_d_o_w errors.
The _X_C_r_e_a_t_e_S_i_m_p_l_e_W_i_n_d_o_w function creates an unmapped _I_n_p_u_t_O_u_t_p_u_t subwindow for a specified parent window, returns the window ID of the created window, and causes the X server to generate a _C_r_e_a_t_e_N_o_t_i_f_y event. The created window is placed on top in the stacking order with respect to siblings. Any part of the window that extends outside its parent window is clipped. The border_width for an _I_n_p_u_t_O_n_l_y window must be zero, or a _B_a_d_M_a_t_c_h error results. _X_C_r_e_a_t_e_S_i_m_p_l_e_W_i_n_d_o_w inherits its depth, class, and visual from its parent. All other window attributes, except background and border, have their default values.
_X_C_r_e_a_t_e_S_i_m_p_l_e_W_i_n_d_o_w can generate _B_a_d_A_l_l_o_c, _B_a_d_M_a_t_c_h, _B_a_d_V_a_l_u_e, and _B_a_d_W_i_n_d_o_w errors.
/* Window attribute value mask bits */
lw(.5i) lw(2.5i) lw(.8i). T{ #define T} T{ _C_W_B_a_c_k_P_i_x_m_a_p T} T{ (1L<<0) T} T{ #define T} T{ _C_W_B_a_c_k_P_i_x_e_l T} T{ (1L<<1) T} T{ #define T} T{ _C_W_B_o_r_d_e_r_P_i_x_m_a_p T} T{ (1L<<2) T} T{ #define T} T{ _C_W_B_o_r_d_e_r_P_i_x_e_l T} T{ (1L<<3) T} T{ #define T} T{ _C_W_B_i_t_G_r_a_v_i_t_y T} T{ (1L<<4) T} T{ #define T} T{ _C_W_W_i_n_G_r_a_v_i_t_y T} T{ (1L<<5) T} T{ #define T} T{ _C_W_B_a_c_k_i_n_g_S_t_o_r_e T} T{ (1L<<6) T} T{ #define T} T{ _C_W_B_a_c_k_i_n_g_P_l_a_n_e_s T} T{ (1L<<7) T} T{ #define T} T{ _C_W_B_a_c_k_i_n_g_P_i_x_e_l T} T{ (1L<<8) T} T{ #define T} T{ _C_W_O_v_e_r_r_i_d_e_R_e_d_i_r_e_c_t T} T{ (1L<<9) T} T{ #define T} T{ _C_W_S_a_v_e_U_n_d_e_r T} T{ (1L<<10) T} T{ #define T} T{ _C_W_E_v_e_n_t_M_a_s_k T} T{ (1L<<11) T} T{ #define T} T{ _C_W_D_o_n_t_P_r_o_p_a_g_a_t_e T} T{ (1L<<12) T} T{ #define T} T{ _C_W_C_o_l_o_r_m_a_p T} T{ (1L<<13) T} T{ #define T} T{ _C_W_C_u_r_s_o_r T} T{ (1L<<14) T}
/* Values */
typedef struct {
Pixmap background_pixmap;/* background, None, or ParentRelative */
unsigned long background_pixel;/* background pixel */
Pixmap border_pixmap; /* border of the window or CopyFromParent */
unsigned long border_pixel;/* border pixel value */
int bit_gravity; /* one of bit gravity values */
int win_gravity; /* one of the window gravity values */
int backing_store; /* NotUseful, WhenMapped, Always */
unsigned long backing_planes;/* planes to be preserved if possible */
unsigned long backing_pixel;/* value to use in restoring planes */
Bool save_under; /* should bits under be saved? (popups) */
long event_mask; /* set of events that should be saved */
long do_not_propagate_mask;/* set of events that should not propagate */
Bool override_redirect; /* boolean value for override_redirect */
Colormap colormap; /* color map to be associated with window */
Cursor cursor; /* cursor to be displayed (or None) */
} XSetWindowAttributes;
For a detailed explanation of the members of this structure, see _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e.