home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xcreatesimplewindow.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  10.9 KB  |  265 lines

  1.  
  2.  
  3.  
  4. XCreateWindow(3X11)      XLIB FUNCTIONS      XCreateWindow(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XCreateWindow, XCreateSimpleWindow, XSetWindowAttributes -
  9.        create windows and window attributes structure
  10.  
  11. SSYYNNTTAAXX
  12.        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,
  13.        _b_o_r_d_e_r___w_i_d_t_h, _d_e_p_t_h,
  14.                   _c_l_a_s_s, _v_i_s_u_a_l, _v_a_l_u_e_m_a_s_k,
  15.        _a_t_t_r_i_b_u_t_e_s)
  16.          Display *_d_i_s_p_l_a_y;
  17.          Window _p_a_r_e_n_t;
  18.          int _x, _y;
  19.          unsigned int _w_i_d_t_h, _h_e_i_g_h_t;
  20.          unsigned int _b_o_r_d_e_r___w_i_d_t_h;
  21.          int _d_e_p_t_h;
  22.          unsigned int _c_l_a_s_s;
  23.          Visual *_v_i_s_u_a_l
  24.          unsigned long _v_a_l_u_e_m_a_s_k;
  25.          XSetWindowAttributes *_a_t_t_r_i_b_u_t_e_s;
  26.  
  27.        Window XCreateSimpleWindow(_d_i_s_p_l_a_y, _p_a_r_e_n_t, _x, _y, _w_i_d_t_h,
  28.        _h_e_i_g_h_t, _b_o_r_d_e_r___w_i_d_t_h,
  29.                     _b_o_r_d_e_r, _b_a_c_k_g_r_o_u_n_d)
  30.          Display *_d_i_s_p_l_a_y;
  31.          Window _p_a_r_e_n_t;
  32.          int _x, _y;
  33.          unsigned int _w_i_d_t_h, _h_e_i_g_h_t;
  34.          unsigned int _b_o_r_d_e_r___w_i_d_t_h;
  35.          unsigned long _b_o_r_d_e_r;
  36.          unsigned long _b_a_c_k_g_r_o_u_n_d;
  37.  
  38. AARRGGUUMMEENNTTSS
  39.        _a_t_t_r_i_b_u_t_e_s
  40.          Specifies the structure from which the values
  41.          (as specified by the value mask) are to be
  42.          taken.     The value mask should have the appropri-
  43.          ate bits set to indicate which attributes have
  44.          been set in the structure.
  45.  
  46.        _b_a_c_k_g_r_o_u_n_d
  47.          Specifies the background pixel value of the win-
  48.          dow.
  49.  
  50.  
  51.        _b_o_r_d_e_r     Specifies the border pixel value of the window.
  52.  
  53.        _b_o_r_d_e_r___w_i_d_t_h
  54.          Specifies the width of the created window's bor-
  55.          der in pixels.
  56.  
  57.        _c_l_a_s_s     Specifies the created window's class.    You can
  58.          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.
  59.          A class of _C_o_p_y_F_r_o_m_P_a_r_e_n_t means the class is
  60.          taken from the parent.
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XCreateWindow(3X11)      XLIB FUNCTIONS      XCreateWindow(3X11)
  71.  
  72.  
  73.        _d_e_p_t_h     Specifies the window's depth.    A depth of _C_o_p_y_-
  74.          _F_r_o_m_P_a_r_e_n_t means the depth is taken from the
  75.          parent.
  76.  
  77.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  78.  
  79.        _p_a_r_e_n_t     Specifies the parent window.
  80.  
  81.        _v_a_l_u_e_m_a_s_k Specifies which window attributes are defined in
  82.          the attributes argument.  This mask is the bit-
  83.          wise inclusive OR of the valid attribute mask
  84.          bits.    If valuemask is zero, the attributes are
  85.          ignored and are not referenced.
  86.  
  87.        _v_i_s_u_a_l     Specifies the visual type.  A visual of _C_o_p_y_-
  88.          _F_r_o_m_P_a_r_e_n_t means the visual type is taken from
  89.          the parent.
  90.  
  91.        _w_i_d_t_h
  92.        _h_e_i_g_h_t     Specify the width and height, which are the cre-
  93.          ated window's inside dimensions and do not
  94.          include the created window's borders.
  95.  
  96.        _x
  97.        _y     Specify the x and y coordinates, which are the
  98.          top-left outside corner of the window's borders
  99.          and are relative to the inside of the parent
  100.          window's borders.
  101.  
  102. DDEESSCCRRIIPPTTIIOONN
  103.        The _X_C_r_e_a_t_e_W_i_n_d_o_w function creates an unmapped subwindow
  104.        for a specified parent window, returns the window ID of
  105.        the created window, and causes the X server to generate a
  106.        _C_r_e_a_t_e_N_o_t_i_f_y event.  The created window is placed on top
  107.        in the stacking order with respect to siblings.
  108.  
  109.        The coordinate system has the X axis horizontal and the Y
  110.        axis vertical with the origin [0, 0] at the upper-left
  111.        corner.    Coordinates are integral, in terms of pixels, and
  112.        coincide with pixel centers.  Each window and pixmap has
  113.        its own coordinate system.  For a window, the origin is
  114.        inside the border at the inside, upper-left corner.
  115.  
  116.        The border_width for an _I_n_p_u_t_O_n_l_y window must be zero, or
  117.        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
  118.        visual type and depth must be a combination supported for
  119.        the screen, or a _B_a_d_M_a_t_c_h error results.     The depth need
  120.        not be the same as the parent, but the parent must not be
  121.        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.
  122.        For an _I_n_p_u_t_O_n_l_y window, the depth must be zero, and the
  123.        visual must be one supported by the screen.  If either
  124.        condition is not met, a _B_a_d_M_a_t_c_h error results.    The par-
  125.        ent window, however, may have any depth and class.  If you
  126.        specify any invalid window attribute for a window, a
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XCreateWindow(3X11)      XLIB FUNCTIONS      XCreateWindow(3X11)
  137.  
  138.  
  139.        _B_a_d_M_a_t_c_h error results.
  140.  
  141.        The created window is not yet displayed (mapped) on the
  142.        user's display.    To display the window, call _X_M_a_p_W_i_n_d_o_w.
  143.        The new window initially uses the same cursor as its par-
  144.        ent.  A new cursor can be defined for the new window by
  145.        calling _X_D_e_f_i_n_e_C_u_r_s_o_r.  The window will not be visible on
  146.        the screen unless it and all of its ancestors are mapped
  147.        and it is not obscured by any of its ancestors.
  148.  
  149.        _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,
  150.        _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.
  151.  
  152.        The _X_C_r_e_a_t_e_S_i_m_p_l_e_W_i_n_d_o_w function creates an unmapped
  153.        _I_n_p_u_t_O_u_t_p_u_t subwindow for a specified parent window,
  154.        returns the window ID of the created window, and causes
  155.        the X server to generate a _C_r_e_a_t_e_N_o_t_i_f_y event.  The cre-
  156.        ated window is placed on top in the stacking order with
  157.        respect to siblings.  Any part of the window that extends
  158.        outside its parent window is clipped.  The border_width
  159.        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
  160.        results.     _X_C_r_e_a_t_e_S_i_m_p_l_e_W_i_n_d_o_w inherits its depth, class,
  161.        and visual from its parent.  All other window attributes,
  162.        except background and border, have their default values.
  163.  
  164.        _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,
  165.        _B_a_d_V_a_l_u_e, and _B_a_d_W_i_n_d_o_w errors.
  166.  
  167. SSTTRRUUCCTTUURREESS
  168.        The _X_S_e_t_W_i_n_d_o_wAttributes structure contains:
  169.  
  170.  
  171.        /* Window attribute value mask bits */
  172.        #define     _C_W_B_a_c_k_P_i_x_m_a_p             (1L<<0)
  173.        #define     _C_W_B_a_c_k_P_i_x_e_l             (1L<<1)
  174.        #define     _C_W_B_o_r_d_e_r_P_i_x_m_a_p             (1L<<2)
  175.        #define     _C_W_B_o_r_d_e_r_P_i_x_e_l             (1L<<3)
  176.        #define     _C_W_B_i_t_G_r_a_v_i_t_y             (1L<<4)
  177.        #define     _C_W_W_i_n_G_r_a_v_i_t_y             (1L<<5)
  178.        #define     _C_W_B_a_c_k_i_n_g_S_t_o_r_e             (1L<<6)
  179.        #define     _C_W_B_a_c_k_i_n_g_P_l_a_n_e_s         (1L<<7)
  180.        #define     _C_W_B_a_c_k_i_n_g_P_i_x_e_l             (1L<<8)
  181.        #define     _C_W_O_v_e_r_r_i_d_e_R_e_d_i_r_e_c_t         (1L<<9)
  182.        #define     _C_W_S_a_v_e_U_n_d_e_r             (1L<<10)
  183.        #define     _C_W_E_v_e_n_t_M_a_s_k             (1L<<11)
  184.        #define     _C_W_D_o_n_t_P_r_o_p_a_g_a_t_e         (1L<<12)
  185.        #define     _C_W_C_o_l_o_r_m_a_p             (1L<<13)
  186.        #define     _C_W_C_u_r_s_o_r             (1L<<14)
  187.        /* Values */
  188.  
  189.        typedef struct {
  190.         Pixmap background_pixmap;/* background, None, or ParentRelative */
  191.         unsigned long background_pixel;/* background pixel */
  192.         Pixmap border_pixmap;    /* border of the window or CopyFromParent */
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. XCreateWindow(3X11)      XLIB FUNCTIONS      XCreateWindow(3X11)
  203.  
  204.  
  205.         unsigned long border_pixel;/* border pixel value */
  206.         int bit_gravity;         /* one of bit gravity values */
  207.         int win_gravity;         /* one of the window gravity values */
  208.         int backing_store;         /* NotUseful, WhenMapped, Always */
  209.         unsigned long backing_planes;/* planes to be preserved if possible */
  210.         unsigned long backing_pixel;/* value to use in restoring planes */
  211.         Bool save_under;         /* should bits under be saved? (popups) */
  212.         long event_mask;         /* set of events that should be saved */
  213.         long do_not_propagate_mask;/* set of events that should not propagate */
  214.         Bool override_redirect;  /* boolean value for override_redirect */
  215.         Colormap colormap;         /* color map to be associated with window */
  216.         Cursor cursor;         /* cursor to be displayed (or None) */
  217.        } XSetWindowAttributes;
  218.  
  219.        For a detailed explanation of the members of this struc-
  220.        ture, see _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e.
  221.  
  222. DDIIAAGGNNOOSSTTIICCSS
  223.        _B_a_d_A_l_l_o_c     The server failed to allocate the requested
  224.          resource or server memory.
  225.  
  226.        _B_a_d_C_o_l_o_r     A value for a Colormap argument does not name a
  227.          defined Colormap.
  228.  
  229.        _B_a_d_C_u_r_s_o_r A value for a Cursor argument does not name a
  230.          defined Cursor.
  231.  
  232.        _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.
  233.  
  234.        _B_a_d_M_a_t_c_h     Some argument or pair of arguments has the cor-
  235.          rect type and range but fails to match in some
  236.          other way required by the request.
  237.  
  238.        _B_a_d_P_i_x_m_a_p A value for a Pixmap argument does not name a
  239.          defined Pixmap.
  240.  
  241.        _B_a_d_V_a_l_u_e     Some numeric value falls outside the range of
  242.          values accepted by the request.  Unless a spe-
  243.          cific range is specified for an argument, the
  244.          full range defined by the argument's type is
  245.          accepted.  Any argument defined as a set of
  246.          alternatives can generate this error.
  247.  
  248.        _B_a_d_W_i_n_d_o_w A value for a Window argument does not name a
  249.          defined Window.
  250.  
  251. SSEEEE AALLSSOO
  252.        XChangeWindowAttributes(3X11), XConfigureWindow(3X11),
  253.        XDefineCursor(3X11), XDestroyWindow(3X11), XMapWin-
  254.        dow(3X11), XRaiseWindow(3X11), XUnmapWindow(3X11)
  255.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.