3.3 Creating Windows
Xlib provides basic ways for creating windows,
and toolkits often supply higher-level functions specifically for
creating and placing top-level windows,
which are discussed in the appropriate toolkit documentation.
If you do not use a toolkit, however,
you must provide some standard information or hints for the window
manager by using the Xlib inter-client communication functions.
If you use Xlib to create your own top-level windows
(direct children of the root window),
you must observe the following rules so that all applications interact
reasonably across the different styles of window management:
You must never fight with the window manager for the size or
placement of your top-level window.
You must be able to deal with whatever size window you get,
even if this means that your application just prints a message
like ``Please make me bigger'' in its window.
You should only attempt to resize or move top-level windows in
direct response to a user request.
If a request to change the size of a top-level window fails,
you must be prepared to live with what you get.
You are free to resize or move the children of top-level
windows as necessary.
(Toolkits often have facilities for automatic relayout.)
If you do not use a toolkit that automatically sets standard window properties,
you should set these properties for top-level windows before mapping them.
For further information,
see "Inter-Client Communication Functions" and the Inter-Client Communication Conventions Manual.
is the more general function that allows you to set specific window attributes
when you create a window.
creates a window that inherits its attributes from its parent window.
<!.IN "Window" "InputOnly">
The X server acts as if
windows do not exist for
the purposes of graphics requests, exposure processing, and
window cannot be used as a
drawable (that is, as a source or destination for graphics requests).
windows act identically in other respects (properties,
grabs, input control, and so on).
Extension packages can define other classes of windows.
To create an unmapped window and set its window attributes, use
To create an unmapped
subwindow of a given parent window, use
Christophe Tronche, firstname.lastname@example.org