[cl-cairo2-devel] XLib-context and UIs
Tamas K Papp
tpapp at Princeton.EDU
Sun Aug 12 20:16:17 UTC 2007
On Sun, Aug 12, 2007 at 10:22:38AM -0400, Joubert Nel wrote:
Hi Joubert,
> I'm keen on using CL-Cairo2 as a means to draw GUIs. I've done some
> initial exploration of the library and am wondering:
>
> 1) There's an xlib-context example, but the windows are fixed-size. Is
> it possible to make resizable windows?
The main problem with X is refreshing the window when X asks for it
(ie the window receives an Expose event). In order to do it
correctly, you either have to keep track of all operations or
double-buffer. cl-cairo2 does the latter, as it is easier to
implement, but this does not allow resizing.
Peter Hildebrandt experimented with the former approach:
http://groups.google.com/group/comp.lang.lisp/msg/9258d245145323b3
you might want to ask him about the current status. This approach
would allow resizing, but is more complicated. If you know what
subset of cl-cairo2 you will be using, perhaps you can get away
implementing recording operations for that subset.
> 2) Is it possible to receive mouse and keyboard events int the
> xlib-context?
The framework is there, you just have to write and event handler.
A new version of cl-cairo2 will be released tomorrow, which contains a
rewritten x11 surface, implemented entirely in Lisp using CFFI (no
extra C glue). If you want to refine the event handler, I suggest you
wait for that and your job will be much easier.
Best,
Tamas
More information about the Cl-cairo2-devel
mailing list