13.3 Standard Geometry
One of the preferences that must be handled by clients is the preferred size and placement of a window or icon. By convention, rather than having the user specify various elements of the size and placement with separate options, clients accept a single standard geometry string, which has the following format:
<width>x<height>{+-}<xoffset>{+-}<yoffset>
Items enclosed in <> are integers, and items enclosed in {}
are a set from which one item is allowed. The
xoffset and
yoffset values are optional. They determine
the position of the window or icon—for the top-level window, they are,
by convention, interpreted relative to the origin of the root window.
The convention is that if the sign of xoffset
or yoffset is positive, they specify that the
offset is measured from the top or left edge of the application window
to the top or left edge of the screen. If the sign of
xoffset or yoffset
is negative, they specify that the offset is measured from the bottom or
right edge of the application window to the bottom or right edge of the
screen.
After being read in from the command line or from a preference
file, this string can be separated into separate x,
y, width, and
height values with
XParseGeometry(). See Chapter 14 for an example that uses
XParseGeometry().
In addition, there is a function called
XWMGeometry() that can be used to parse a partial
geometry specification from the user. XWMGeometry() takes a geometry string specified (presumably) by the user, which might ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access