XCreateWindow(3X) — X Version 11
NAME
XCreateWindow, XCreateSimpleWindow − create windows
SYNTAX
Window XCreateWindow(display, parent, x, y, width, height, border_width, depth,
class, visual, valuemask, attributes)
Display ∗display;
Window parent;
int x, y;
unsigned int width, height;
unsigned int border_width;
int depth;
unsigned int class;
Visual ∗visual
unsigned long valuemask;
XSetWindowAttributes ∗attributes;
Window XCreateSimpleWindow(display, parent, x, y, width, height, border_width,
border, background)
Display ∗display;
Window parent;
int x, y;
unsigned int width, height, border_width;
unsigned long border;
unsigned long background;
ARGUMENTS
attributesAttributes of the window to be set at creation time should be set in this structure. The valuemask should have the appropriate bits set to indicate which attributes have been set in the structure.
backgroundSpecifies the background pixel value of the window.
borderSpecifies the border pixel value of the window.
border_widthSpecifies, in pixels, the width of the created window’s border. The border_width for an InputOnly window must be zero. Otherwise, a BadMatch error is returned.
classSpecifies the created window’s class. You can pass one of these constants: InputOutput, InputOnly, or CopyFromParent. A class of CopyFromParent means the class is taken from the parent.
depthA depth of zero for class InputOutput or CopyFromParent means the depth is taken from the parent.
displaySpecifies the connection to the X server.
parentSpecifies the parent window ID.
valuemaskSpecifies 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.
visualSpecifies the visual type. A visual of CopyFromParent means the visual type is taken from the parent.
width
heightSpecify the width and height.
x
ySpecify the x and y coordinates.
DESCRIPTION
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. .PN XCreateWindow can generate BadAlloc BadColor, BadCursor, BadMatch, BadPixmap, BadValue, and BadWindow errors.
The XCreateSimpleWindow function creates an unmapped InputOutput subwindow for a specified parent window, returns the window ID of the created window, and causes the X server to generate a CreateNotify event. .PN XCreateSimpleWindow can generate BadAlloc, BadMatch, BadValue, and BadWindow errors.
DIAGNOSTICS
BadAlloc The server failed to allocate the requested resource or server memory.
BadColor A value for a Colormap argument does not name a defined Colormap.
BadCursor A value for a Cursor argument does not name a defined Cursor.
BadMatch The values do not exist for an InputOnly window.
BadMatch Some argument or pair of arguments has the correct type and range but fails to match in some other way required by the request.
BadPixmap A value for a Pixmap argument does not name a defined Pixmap.
BadValue Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument’s type is accepted. Any argument defined as a set of alternatives can generate this error.
BadWindow A value for a Window argument does not name a defined Window.
SEE ALSO
XChangeWindowAttributes(3X), XConfigureWindow(3X), XDestroyWindow(3X), XMapWindow(3X), XRaiseWindow(3X), XUnmapWindow(3X)
Xlib − C Language X Interface
1 March 1988