[Openmcl-devel] Core Animation demo

Neil Baylis neil.baylis at gmail.com
Mon Jul 6 22:14:21 PDT 2009

I've attached a small demo of how to get Cocoa Core Animation working.

I'm not sure I've done it all correctly, but it does work. If anyone  
knows better ways to implement the functions set-layer-position and  
set-layer-bounds, I'd be pleased to hear. In fact any comments at all  
would be welcome, especially in terms of how to make it more in the  
lisp idiom. I'm particularly not sure about the need to use make- 
record, but couldn't find a better way to make the CGxxx objects.

You'll need to use a 64 bit CCL, and you'll need to make the  
interfaces for the ApplicationServices framework. I did this by  
following the instructions in the CCL docs, and everything went fine.  
You'll also need to provide a small image (e.g. .jpg or .png) for it  
to work with. If it can't read the image, you'll just get a blank  
window with no warning.

Basically, you click on the window, and the image moves to the place  
you clicked. But you'll notice there's no code to animate the image.  
In fact there's not even a drawRect provided for the view. It's all  
done by the CA functionality in Cocoa. This is the most minimal demo I  
could think of that would be useful.

It took me a long time to get this working, so I hope someone finds it  

Neil Baylis

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ca-demo.lisp
Type: application/octet-stream
Size: 3385 bytes
Desc: not available
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20090706/f1b1e9ad/attachment.obj>
-------------- next part --------------

More information about the Openmcl-devel mailing list