Next: , Previous: , Up: Drawables   [Contents][Index]


3.1 Windows and Pixmaps

Function: x:create-window window position size border-width depth class visual field-name value …

Creates and returns an unmapped Input-Output subwindow for a specified parent 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. Any part of the window that extends outside its parent window is clipped. The border-width for an x:Input-Only window must be zero.

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.

Class can be x:Input-Output, x:Input-Only, or x:Copy-From-Parent. For class x:Input-Output, the visual type and depth must be a combination supported for the screen. The depth need not be the same as the parent, but the parent must not be a window of class x:Input-Only. For an x:Input-Only window, the depth must be zero, and the visual must be one supported by the screen.

The returned window will have the attributes specified by field-names and value.

Function: x:create-window window position size border-width border background

The returned window inherits its depth, class, and visual from its parent. All other window attributes, except background and border, have their default values.

Function: x:create-pixmap drawable size depth
Function: x:create-pixmap display size depth

size is a list, vector, or pair of nonzero integers specifying the width and height desired in the new pixmap.

x:create-pixmap returns a new pixmap of the width, height, and depth specified. It is valid to pass an x:Input-Only window to the drawable argument. The depth argument must be one of the depths supported by the screen of the specified drawable.

Function: x:close window

Destroys the specified window as well as all of its subwindows and causes the X server to generate a DestroyNotify event for each window. The window should not be used again. If the window specified by the window argument is mapped, it is unmapped automatically. The ordering of the DestroyNotify events is such that for any given window being destroyed, DestroyNotify is generated on any inferiors of the window before being generated on the window itself. The ordering among siblings and across subhierarchies is not otherwise constrained. If the window you specified is a root window, an error is signaled. Destroying a mapped window will generate x:Expose events on other windows that were obscured by the window being destroyed.

Function: x:close pixmap

Deletes the association between the pixmap and its storage. The X server frees the pixmap storage when there are no references to it.

Function: x:window-geometry drawable

Returns a list of:

coordinates

list of x and y coordinates that define the location of the drawable. For a window, these coordinates specify the upper-left outer corner relative to its parent’s origin. For pixmaps, these coordinates are always zero.

size

list of the drawable’s dimensions (width and height). For a window, these dimensions specify the inside size, not including the border.

border-width

The border width in pixels. If the drawable is a pixmap, this is zero.

depth

The depth of the drawable (bits per pixel for the object).

Function: x:window-geometry-set! window field-name value …

Changes the Configuration components specified by field-names for the specified window.

These are the attributes settable by x:window-geometry-set!. That these attributes are encoded by small integers – just like those of the next section. Be warned therefore that confusion of attribute names will likely not signal errors, just cause mysterious behavior.

Attribute: x:CWX
Attribute: x:CWY
Attribute: x:CW-Width
Attribute: x:CW-Height

The x:CWX and x:CYY members are used to set the window’s x and y coordinates, which are relative to the parent’s origin and indicate the position of the upper-left outer corner of the window. The x:CW-Width and x:CW-Height members are used to set the inside size of the window, not including the border, and must be nonzero. Attempts to configure a root window have no effect.

If a window’s size actually changes, the window’s subwindows move according to their window gravity. Depending on the window’s bit gravity, the contents of the window also may be moved

Attribute: x:CW-Border-Width

The integer x:CW-Border-Width is used to set the width of the border in pixels. Note that setting just the border width leaves the outer-left corner of the window in a fixed position but moves the absolute position of the window’s origin. It is an error to set the border-width attribute of an InputOnly window nonzero.

Attribute: x:CW-Sibling

The sibling member is used to set the sibling window for stacking operations.

Attribute: x:CW-Stack-Mode

The x:CW-Stack-Mode member is used to set how the window is to be restacked and can be set to x:Above, x:Below, x:Top-If, x:Bottom-If, or x:Opposite.

If a sibling and a stack-mode are specified, the window is restacked as follows:

x:Above

The window is placed just above the sibling.

x:Below

The window is placed just below the sibling.

x:Top-If

If the sibling occludes the window, the window is placed at the top of the stack.

x:Bottom-If

If the window occludes the sibling, the window is placed at the bottom of the stack.

x:Opposite

If the sibling occludes the window, the window is placed at the top of the stack. If the window occludes the sibling, the window is placed at the bottom of the stack.

If a stack-mode is specified but no sibling is specified, the window is restacked as follows:

x:Above

The window is placed at the top of the stack.

x:Below

The window is placed at the bottom of the stack.

x:Top-If

If any sibling occludes the window, the window is placed at the top of the stack.

x:Bottom-If

If the window occludes any sibling, the window is placed at the bottom of the stack.

x:Opposite

If any sibling occludes the window, the window is placed at the top of the stack. If the window occludes any sibling, the window is placed at the bottom of the stack.


Next: Window Attributes, Previous: Drawables, Up: Drawables   [Contents][Index]