Alan Crowe <firstname.lastname@example.org> wrote:
| Is "Play with CLX" a reasonable suggestion?
| I've written notes at
| which offer a far gentler (and sadly incomplete)
| introduction to CLX programming than the usual texts.
Thanks! This is a much better introduction than my own
clumsy first CLX attempts. ;-}
One thing you might want to add, though. In your "examples.txt",
you include the following [understandable!] complaint:
(my-window (xlib:create-window :parent root-window
:x 0 :y 0 :width 200 :height 100)))
This is the line you have been waiting for, that creates a
window. Frustratingly, :x and :y are required parameters.
You have to say where you want it, even though, as a top level
window, the window manager will intervene and put it where it
thinks best. The window manager can also overrule your chosen
width and height, though that is less common.
Fortunately, there is a simple solution for this!! Just add this after
your XLIB:CREATE-WINDOW call but before the XLIB:MAP-WINDOW call:
:name my-window-title ; a string
:icon-name my-icon-title ; a string
The magic is the ":USER-SPECIFIED-POSITION-P T", which asks the window
manager to respect the requested X & Y from the CREATE-WINDOW call.
Now you can place your windows wherever you want. ;-} ;-}
Rob Warnock <email@example.com>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607