


XCreateWindow(3X11)					  XCreateWindow(3X11)
X11R5									X11R5



NAME
  XCreateWindow, XCreateSimpleWindow, XSetWindowAttributes - create windows
  and window attributes	structure

SYNTAX
  Window XCreateWindow(_d_i_s_p_l_a_y,	_p_a_r_e_n_t,	_x, _y, _w_i_d_t_h, _h_e_i_g_h_t, _b_o_r_d_e_r__w_i_d_t_h,
  _d_e_p_t_h,
			 _c_l_a_s_s,	_v_i_s_u_a_l,	_v_a_l_u_e_m_a_s_k, _a_t_t_r_i_b_u_t_e_s)
	Display	*_d_i_s_p_l_a_y;
	Window _p_a_r_e_n_t;
	int _x, _y;
	unsigned int _w_i_d_t_h, _h_e_i_g_h_t;
	unsigned int _b_o_r_d_e_r__w_i_d_t_h;
	int _d_e_p_t_h;
	unsigned int _c_l_a_s_s;
	Visual *_v_i_s_u_a_l
	unsigned long _v_a_l_u_e_m_a_s_k;
	XSetWindowAttributes *_a_t_t_r_i_b_u_t_e_s;

  Window XCreateSimpleWindow(_d_i_s_p_l_a_y, _p_a_r_e_n_t, _x, _y, _w_i_d_t_h, _h_e_i_g_h_t,
  _b_o_r_d_e_r__w_i_d_t_h,
			       _b_o_r_d_e_r, _b_a_c_k_g_r_o_u_n_d)
	Display	*_d_i_s_p_l_a_y;
	Window _p_a_r_e_n_t;
	int _x, _y;
	unsigned int _w_i_d_t_h, _h_e_i_g_h_t;
	unsigned int _b_o_r_d_e_r__w_i_d_t_h;
	unsigned long _b_o_r_d_e_r;
	unsigned long _b_a_c_k_g_r_o_u_n_d;

ARGUMENTS

  _a_t_t_r_i_b_u_t_e_s
	    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.

  _b_a_c_k_g_r_o_u_n_d
	    Specifies the background pixel value of the	window.


  _b_o_r_d_e_r    Specifies the border pixel value of	the window.

  _b_o_r_d_e_r__w_i_d_t_h
	    Specifies the width	of the created window's	border in pixels.

  _c_l_a_s_s	    Specifies the created window's class.  You can pass	_I_n_p_u_t_O_u_t_p_u_t,
	    _I_n_p_u_t_O_n_l_y, or _C_o_p_y_F_r_o_m_P_a_r_e_n_t.  A class of _C_o_p_y_F_r_o_m_P_a_r_e_n_t means
	    the	class is taken from the	parent.

  _d_e_p_t_h	    Specifies the window's depth.  A depth of _C_o_p_y_F_r_o_m_P_a_r_e_n_t means
	    the	depth is taken from the	parent.

  _d_i_s_p_l_a_y   Specifies the connection to	the X server.

  _p_a_r_e_n_t    Specifies the parent window.

  _v_a_l_u_e_m_a_s_k 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.

  _v_i_s_u_a_l    Specifies the visual type.	A visual of _C_o_p_y_F_r_o_m_P_a_r_e_n_t means the
	    visual type	is taken from the parent.

  _w_i_d_t_h
  _h_e_i_g_h_t    Specify the	width and height, which	are the	created	window's
	    inside dimensions and do not include the created window's bord-
	    ers.

  _x
  _y	    Specify the	x and y	coordinates, which are the top-left outside
	    corner of the window's borders and are relative to the inside of
	    the	parent window's	borders.

DESCRIPTION
  The _X_C_r_e_a_t_e_W_i_n_d_o_w 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 _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.

  The coordinate system	has the	X axis horizontal and the Y axis vertical,
  with the origin [0, 0] at the	upper left.  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.

  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 combi-
  nation 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 win-
  dow 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.




STRUCTURES
  The _X_S_e_t_W_i_n_d_o_wAttributes structure contains:

  /* Window attribute value mask bits */


  #define

	    _C_W_B_a_c_k_P_i_x_m_a_p

				 (1L<<0)


  #define

	    _C_W_B_a_c_k_P_i_x_e_l

				 (1L<<1)


  #define

	    _C_W_B_o_r_d_e_r_P_i_x_m_a_p

				 (1L<<2)


  #define

	    _C_W_B_o_r_d_e_r_P_i_x_e_l

				 (1L<<3)


  #define

	    _C_W_B_i_t_G_r_a_v_i_t_y

				 (1L<<4)


  #define

	    _C_W_W_i_n_G_r_a_v_i_t_y

				 (1L<<5)


  #define

	    _C_W_B_a_c_k_i_n_g_S_t_o_r_e

				 (1L<<6)


  #define

	    _C_W_B_a_c_k_i_n_g_P_l_a_n_e_s

				 (1L<<7)


  #define

	    _C_W_B_a_c_k_i_n_g_P_i_x_e_l

				 (1L<<8)


  #define

	    _C_W_O_v_e_r_r_i_d_e_R_e_d_i_r_e_c_t

				 (1L<<9)


  #define

	    _C_W_S_a_v_e_U_n_d_e_r

				 (1L<<10)


  #define

	    _C_W_E_v_e_n_t_M_a_s_k

				 (1L<<11)


  #define

	    _C_W_D_o_n_t_P_r_o_p_a_g_a_t_e

				 (1L<<12)


  #define

	    _C_W_C_o_l_o_r_m_a_p

				 (1L<<13)


  #define

	    _C_W_C_u_r_s_o_r

				 (1L<<14)

  /* 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.

DIAGNOSTICS

  _B_a_d_A_l_l_o_c  The	server failed to allocate the requested	resource or server
	    memory.

  _B_a_d_C_o_l_o_r  A value for	a Colormap argument does not name a defined Colormap.

  _B_a_d_C_u_r_s_o_r A value for	a Cursor argument does not name	a defined Cursor.

  _B_a_d_M_a_t_c_h  The	values do not exist for	an _I_n_p_u_t_O_n_l_y window.

  _B_a_d_M_a_t_c_h  Some argument or pair of arguments has the correct type and	range
	    but	fails to match in some other way required by the request.

  _B_a_d_P_i_x_m_a_p A value for	a Pixmap argument does not name	a defined Pixmap.

  _B_a_d_V_a_l_u_e  Some numeric value falls outside the range of values accepted by
	    the	request.  Unless a specific range is specified for an argu-
	    ment, the full range defined by the	argument's type	is accepted.
	    Any	argument defined as a set of alternatives can generate this
	    error.

  _B_a_d_W_i_n_d_o_w A value for	a Window argument does not name	a defined Window.

SEE ALSO
  XChangeWindowAttributes(3X11), XConfigureWindow(3X11), XDefineCursor(3X11),
  XDestroyWindow(3X11),	XMapWindow(3X11), XRaiseWindow(3X11),
  XUnmapWindow(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e




























































