Window Attributes

The appearance and behavior of a window is largely determined by window attributes. The ProXL primitives create_window/2, put_window_attributes/2, and get_window_attributes/2 form a family whose first argument is a windowable and whose second argument is a list of attributes. The first two primitives give attributes to a window, and the last allows you to inquire about the current state of a window.

The available attributes are listed here. The right hand column describes the attribute, lists the values of the variable (describing them when necessary), and indicates the default value of V.


Attribute
Description and values
parent(V)
This window's parent window. Defaults to the root window of default screen on window creation.
x(V)
Left edge of window, relative to parent window's inside left edge, in pixels. Default is 0.
y(V)
Top edge of window, relative to parent window's inside top edge, in pixels. Default is 0.
position(X,Y)
X and Y of window relative to parent upper left corner, in pixels. Same as x(X), y(Y).
width(V)
Inside width of window in pixels. Default is 100.
height(V)
Inside height of window in pixels. Default is 100.
size(W,H)
Same as width(W), height(h).
depth(V)
Bits per pixel. Default is parent's depth. This attribute cannot be modified once a window is created.
border_width(V)
width of window's border, in pixels. Default is 0.
class(V)
Can this window be drawn in, or is it only for getting input? V is either:

This attribute cannot be modified once a window is created.

visual(V)
The window's visual. Default is the visual of the window's parent's screen. See pxl-col. This attribute cannot be modified once a window is created.
background(V)
The window's background. V may be

Due to the design of the X window system itself, this attribute cannot be determined, but only modified.

border(V)
The pattern to be displayed in the window's border. V may be

Due to the design of the X window system itself, this attribute cannot be determined, but only modified.

bit_gravity(V)
Where to put the contents of the window if it is resized. V may be one of
win_gravity(V)
Where to put the subwindows of a window that has been resized. V may be one of
backing_store(V)
Should the contents of this window be saved by the server when it is occluded by another window? V should be one of:

Note that some screens don't support backing store, and even those that do may not always provide it when asked. Your application must always be prepared to repaint its own windows.

backing_bit_planes(V)
If backing_store is used, which planes should be saved? V is a bit mask. The default is to save all planes (i.e., V = -1).
backing_pixel(V)
Specifies the bit values to put into unbacked planes when restoring from backing store. Default is 0.
save_under(V)
Should what is under this window be saved so that when the window is moved or unmapped, the newly exposed part of the screen can be refreshed without asking any applications to do the work? Like backing_store(V), not all screens support this, and those that do might not support it whenever asked to. V may be either:
event_mask(V)
An integer bitmask indicating which events this window wants to handle. Note that if you use the ProXL callback mechanism, you should not modify this attribute directly.
do_not_propagate_mask(V)
An integer bitmask indicating which events not to propagate. Any event destined for this window not specified by either event_mask(V) or do_not_propagate_mask(V) will be forwarded to this window's parent.
override_redirect(V)
Override redirection of map and configure requests? Possible values of V are

false
(default) A program, usually a window manager, can specify that requests to map or reconfigure a child of a certain window, usually the root, should be sent to it. This allows a window manager to decide not to allow top level windows to be moved or reshaped, and to put title bars and special borders on top level windows.
true
Map and configure requests should go directly to the server. This allows you to pop up a window, say a menu, where you want it, and without any adornments the window manager would put on it.

colormap(V)
V may be either:
cursor(V)
V may be either:

cursor
the cursor to display when the cursor is in this window
none
the parent window's cursor will be displayed.

Due to the design of the X window system itself, this attribute cannot be determined, but only modified.

mapped(V)
Is this window on the screen, providing that its parent is? Possible values are

false
(default)
true

viewable
the window is on the screen; that is, the window is mapped, and its parent is viewable. The root window is always viewable.

gc(V)
The default graphics context for this window. The default is the screen's default gc. See pxl-graf for more information.
property(N,V)
V is the value of the N property of the window. If N is unbound, it will backtrack through all the properties of the window. If N is bound, it should be an atom. See pxl-win-wmi for information on how to use the property(N,V) attribute to tell a window manager how to handle your windows.
callback(E,F,V,C,G)
Register G as the goal to call when event E is received by the window. F is a list of fields of the event to be accessed before calling G, and V is a variable, which may be passed back to the handle_events procedure in order to exit the handle_events loop. If V is none, then no result will be passed to handle_events. C is the context of the call, which is specified as the second argument to handle_events/2. This allows a callback's behavior to depend on the context in which it occurs. See pxl-ev for more information.
callback(E,F,V,G)
Equivalent to callback(E,F,V,_,G).
callback(E,F,G)
Equivalent to callback(E,F,none,_,G).