[cl-cairo2-devel] X11 sample in Aug 22 version

Tamas K Papp tpapp at Princeton.EDU
Sat Aug 25 12:42:11 UTC 2007


On Fri, Aug 24, 2007 at 10:44:40PM -0400, Joubert Nel wrote:
> Hi,
> 
> When I try to run the X11 example in the Aug 22 version, the following
> happens:
> 
> --------------------------------------------------------------
> 
> CL-USER> (load
> "/tank/lisp/sbcl/lib/sbcl/site/cl-cairo2-latest/tutorial/x11-example.lisp")
> ; in: LAMBDA NIL
> ;     CAIRO-XLIB-EXAMPLE::OPEN-X11-DISPLAY
> ; 
> ; caught STYLE-WARNING:
> ;   undefined function: OPEN-X11-DISPLAY
> 
> ; 
> ; caught STYLE-WARNING:
> ;   This function is undefined:
> ;     OPEN-X11-DISPLAY
> ; 
> ; compilation unit finished
> ;   caught 2 STYLE-WARNING conditions
> ; Evaluation aborted.
> CL-USER> 
> 
> --------------------------------------------------------------
> 
> Does it work for anybody else?

Hi Joubert,

My mistake, the X11 code has been rewritten again.  Sorry for the
frequent changes, the only justification is that I hope it is getting
better and cleaner each time.

You will find the corrected version of x11-example.lisp on the site
now.  In the current version, each window has its own event loop and
thread (in the previous code, it used to be one loop/thread per
display).  I find this approach eliminates some rare but nasty
redrawing bugs.

Currently, you can create xlib contexts with

(create-xlib-context width height)

and you can supply optional arguments display-name (if nil as by
default, Xlib will use your $DISPLAY settings) and window-name
(the title of the window).

Also, in the current version you will find sync-lock, sync-unlock and
the macro

(with-sync-lock (context)
  ...)
  
which suspends redrawing the window for operations in its body.  Use
it for drawings with lots of elements, they will appear on the screen
at the same time, and drawing will be much faster.

I hope that there will be no more major reorganizations in the X11
code, at least the API.

HTH,

Tamas



More information about the Cl-cairo2-devel mailing list