Next: , Previous: , Up: X Graphics   [Contents][Index]


17.9.2 Utilities for X Graphics

procedure: x-graphics/open-display display-name

Opens a connection to the display whose name is display-name, returning a display object. If unable to open a connection, #f is returned. Display-name is normally a string, which is an X display name in the usual form; however, #f is also allowed, meaning to use the value of the unix environment variable DISPLAY.

procedure: x-graphics/close-display display

Closes display; after calling this procedure, it is an error to use display for any purpose. Any windows that were previously opened on display are destroyed and their resources returned to the operating system.

procedure: x-close-all-displays

Closes all open connections to X displays. Equivalent to calling x-close-display on all open displays.

procedure: x-geometry-string x y width height

This procedure creates and returns a standard X geometry string from the given arguments. X and y must be either exact integers or #f, while width and height must be either exact non-negative integers or #f. Usually either x and y are both specified or both #f; similarly for width and height. If only one of the elements of such a pair is specified, it is ignored.

Examples:

(x-geometry-string #f #f 100 200) ⇒ "100x200"
(x-geometry-string 2 -3 100 200) ⇒ "100x200+2-3"
(x-geometry-string 2 -3 #f #f) ⇒ "+2-3"

Note that the x and y arguments cannot distinguish between +0 and -0, even though these have different meanings in X. If either of those arguments is 0, it means +0 in X terminology. If you need to distinguish these two cases you must create your own geometry string using Scheme’s string and number primitives.


Next: , Previous: , Up: X Graphics   [Contents][Index]