home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / X11 / XCreateWindow.z / XCreateWindow
Encoding:
Text File  |  1998-10-30  |  16.6 KB  |  505 lines

  1.  
  2.  
  3.  
  4.      XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XCreateWindow, XCreateSimpleWindow, XSetWindowAttributes -
  10.           create windows and window attributes structure
  11.  
  12.      SSSSYYYYNNNNTTTTAAAAXXXX
  13.           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,
  14.           _b_o_r_d_e_r__w_i_d_t_h, _d_e_p_t_h,
  15.                                  _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)
  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.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  39.           _a_t_t_r_i_b_u_t_e_s
  40.                     Specifies the structure from which the values (as
  41.                     specified by the value mask) are to be taken.  The
  42.                     value mask should have the appropriate bits set to
  43.                     indicate which attributes have been set in the
  44.                     structure.
  45.  
  46.           _b_a_c_k_g_r_o_u_n_d
  47.                     Specifies the background pixel value of the
  48.                     window.
  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 border
  55.                     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.  A
  59.                     class of _C_o_p_y_F_r_o_m_P_a_r_e_n_t means the class is taken
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/30/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.                     from the parent.
  75.  
  76.           _d_e_p_t_h     Specifies the window's depth.  A depth of
  77.                     _C_o_p_y_F_r_o_m_P_a_r_e_n_t means the depth is taken from the
  78.                     parent.
  79.  
  80.           _d_i_s_p_l_a_y   Specifies the connection to the X server.
  81.  
  82.           _p_a_r_e_n_t    Specifies the parent window.
  83.  
  84.           _v_a_l_u_e_m_a_s_k Specifies which window attributes are defined in
  85.                     the attributes argument.  This mask is the bitwise
  86.                     inclusive OR of the valid attribute mask bits.  If
  87.                     valuemask is zero, the attributes are ignored and
  88.                     are not referenced.
  89.  
  90.           _v_i_s_u_a_l    Specifies the visual type.  A visual of
  91.                     _C_o_p_y_F_r_o_m_P_a_r_e_n_t means the visual type is taken from
  92.                     the parent.
  93.  
  94.           _w_i_d_t_h
  95.           _h_e_i_g_h_t    Specify the width and height, which are the
  96.                     created window's inside dimensions and do not
  97.                     include the created window's borders.
  98.  
  99.           _x
  100.           _y         Specify the x and y coordinates, which are the
  101.                     top-left outside corner of the window's borders
  102.                     and are relative to the inside of the parent
  103.                     window's borders.
  104.  
  105.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  106.           The _X_C_r_e_a_t_e_W_i_n_d_o_w function creates an unmapped subwindow for
  107.           a specified parent window, returns the window ID of the
  108.           created window, and causes the X server to generate a
  109.           _C_r_e_a_t_e_N_o_t_i_f_y event.  The created window is placed on top in
  110.           the stacking order with respect to siblings.
  111.  
  112.           The coordinate system has the X axis horizontal and the Y
  113.           axis vertical with the origin [0, 0] at the upper-left
  114.           corner.  Coordinates are integral, in terms of pixels, and
  115.           coincide with pixel centers.  Each window and pixmap has its
  116.           own coordinate system.  For a window, the origin is inside
  117.           the border at the inside, upper-left corner.
  118.  
  119.           The border_width for an _I_n_p_u_t_O_n_l_y window must be zero, or a
  120.           _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
  121.           type and depth must be a combination supported for the
  122.           screen, or a _B_a_d_M_a_t_c_h error results.  The depth need not be
  123.           the same as the parent, but the parent must not be a window
  124.           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
  125.           _I_n_p_u_t_O_n_l_y window, the depth must be zero, and the visual
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/30/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))
  137.  
  138.  
  139.  
  140.           must be one supported by the screen.  If either condition is
  141.           not met, a _B_a_d_M_a_t_c_h error results.  The parent window,
  142.           however, may have any depth and class.  If you specify any
  143.           invalid window attribute for a window, a _B_a_d_M_a_t_c_h error
  144.           results.
  145.  
  146.           The created window is not yet displayed (mapped) on the
  147.           user's display.  To display the window, call _X_M_a_p_W_i_n_d_o_w.
  148.           The new window initially uses the same cursor as its parent.
  149.           A new cursor can be defined for the new window by calling
  150.           _X_D_e_f_i_n_e_C_u_r_s_o_r.  The window will not be visible on the screen
  151.           unless it and all of its ancestors are mapped and it is not
  152.           obscured by any of its ancestors.
  153.  
  154.           _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,
  155.           _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.
  156.  
  157.           The _X_C_r_e_a_t_e_S_i_m_p_l_e_W_i_n_d_o_w function creates an unmapped
  158.           _I_n_p_u_t_O_u_t_p_u_t subwindow for a specified parent window, returns
  159.           the window ID of the created window, and causes the X server
  160.           to generate a _C_r_e_a_t_e_N_o_t_i_f_y event.  The created window is
  161.           placed on top in the stacking order with respect to
  162.           siblings.  Any part of the window that extends outside its
  163.           parent window is clipped.  The border_width for an _I_n_p_u_t_O_n_l_y
  164.           window must be zero, or a _B_a_d_M_a_t_c_h error results.
  165.           _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
  166.           from its parent.  All other window attributes, except
  167.           background and border, have their default values.
  168.  
  169.           _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,
  170.           _B_a_d_V_a_l_u_e, and _B_a_d_W_i_n_d_o_w errors.
  171.  
  172.      SSSSTTTTRRRRUUUUCCCCTTTTUUUURRRREEEESSSS
  173.           The _X_S_e_t_W_i_n_d_o_wAttributes structure contains:
  174.  
  175.           /* Window attribute value mask bits */
  176.           #define
  177.                     _C_W_B_a_c_k_P_i_x_m_a_p
  178.                                                 (1L<<0)
  179.           #define
  180.                     _C_W_B_a_c_k_P_i_x_e_l
  181.                                                 (1L<<1)
  182.           #define
  183.                     _C_W_B_o_r_d_e_r_P_i_x_m_a_p
  184.                                                 (1L<<2)
  185.           #define
  186.                     _C_W_B_o_r_d_e_r_P_i_x_e_l
  187.                                                 (1L<<3)
  188.           #define
  189.                     _C_W_B_i_t_G_r_a_v_i_t_y
  190.                                                 (1L<<4)
  191.           #define
  192.                     _C_W_W_i_n_G_r_a_v_i_t_y
  193.                                                 (1L<<5)
  194.           #define
  195.                     _C_W_B_a_c_k_i_n_g_S_t_o_r_e
  196.                                                 (1L<<6)
  197.           #define
  198.                     _C_W_B_a_c_k_i_n_g_P_l_a_n_e_s
  199.                                                 (1L<<7)
  200.           #define
  201.                     _C_W_B_a_c_k_i_n_g_P_i_x_e_l
  202.                                                 (1L<<8)
  203.           #define
  204.                     _C_W_O_v_e_r_r_i_d_e_R_e_d_i_r_e_c_t
  205.                                                 (1L<<9)
  206.           #define
  207.                     _C_W_S_a_v_e_U_n_d_e_r
  208.                                                 (1L<<10)
  209.           #define
  210.                     _C_W_E_v_e_n_t_M_a_s_k
  211.                                                 (1L<<11)
  212.           #define
  213.                     _C_W_D_o_n_t_P_r_o_p_a_g_a_t_e
  214.                                                 (1L<<12)
  215.           #define
  216.  
  217.  
  218.  
  219.  
  220.  
  221.      Page 3                                          (printed 4/30/98)
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.      XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))
  229.  
  230.  
  231.  
  232.                     _C_W_C_o_l_o_r_m_a_p
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.                                                 (1L<<13)
  282.  
  283.  
  284.  
  285.  
  286.  
  287.      Page 4                                          (printed 4/30/98)
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.      XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.      Page 5                                          (printed 4/30/98)
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.      XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))
  361.  
  362.  
  363.  
  364.           #define
  365.                     _C_W_C_u_r_s_o_r
  366.                                                 (1L<<14)
  367.           /* Values */
  368.  
  369.           typedef struct {
  370.                Pixmap background_pixmap;/* background, None, or ParentRelative */
  371.                unsigned long background_pixel;/* background pixel */
  372.                Pixmap border_pixmap;    /* border of the window or CopyFromParent */
  373.                unsigned long border_pixel;/* border pixel value */
  374.                int bit_gravity;         /* one of bit gravity values */
  375.                int win_gravity;         /* one of the window gravity values */
  376.                int backing_store;       /* NotUseful, WhenMapped, Always */
  377.                unsigned long backing_planes;/* planes to be preserved if possible */
  378.                unsigned long backing_pixel;/* value to use in restoring planes */
  379.                Bool save_under;         /* should bits under be saved? (popups) */
  380.                long event_mask;         /* set of events that should be saved */
  381.                long do_not_propagate_mask;/* set of events that should not propagate */
  382.                Bool override_redirect;  /* boolean value for override_redirect */
  383.                Colormap colormap;       /* color map to be associated with window */
  384.                Cursor cursor;           /* cursor to be displayed (or None) */
  385.           } XSetWindowAttributes;
  386.  
  387.           For a detailed explanation of the members of this structure,
  388.           see _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e.
  389.  
  390.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  391.           _B_a_d_A_l_l_o_c  The server failed to allocate the requested
  392.                     resource or server memory.
  393.  
  394.           _B_a_d_C_o_l_o_r  A value for a Colormap argument does not name a
  395.                     defined Colormap.
  396.  
  397.           _B_a_d_C_u_r_s_o_r A value for a Cursor argument does not name a
  398.                     defined Cursor.
  399.  
  400.           _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.
  401.  
  402.           _B_a_d_M_a_t_c_h  Some argument or pair of arguments has the correct
  403.                     type and range but fails to match in some other
  404.                     way required by the request.
  405.  
  406.           _B_a_d_P_i_x_m_a_p A value for a Pixmap argument does not name a
  407.                     defined Pixmap.
  408.  
  409.           _B_a_d_V_a_l_u_e  Some numeric value falls outside the range of
  410.                     values accepted by the request.  Unless a specific
  411.                     range is specified for an argument, the full range
  412.                     defined by the argument's type is accepted.  Any
  413.                     argument defined as a set of alternatives can
  414.                     generate this error.
  415.  
  416.           _B_a_d_W_i_n_d_o_w A value for a Window argument does not name a
  417.                     defined Window.
  418.  
  419.  
  420.  
  421.      Page 6                                          (printed 4/30/98)
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.      XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww((((3333XXXX11111111))))
  429.  
  430.  
  431.  
  432.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  433.           XChangeWindowAttributes(3X11), XConfigureWindow(3X11),
  434.           XDefineCursor(3X11), XDestroyWindow(3X11), XMapWindow(3X11),
  435.           XRaiseWindow(3X11), XUnmapWindow(3X11)
  436.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.      Page 7                                          (printed 4/30/98)
  488.  
  489.  
  490.  
  491.