[cells-gtk-devel] cells-gtk drawing-area widget

Peter Hildebrandt peter.hildebrandt at gmail.com
Mon Jul 16 19:45:54 UTC 2007


On Tue, 12 Jun 2007 07:16:21 -0700, Peter Denno <peter.denno at nist.gov>  
wrote:
  I'll check it out soon, and if things work OK, merge it in. I haven't
> worked on this code in at least a year, but I seem to recall having a
> plan to use closures to draw things.  We are intending to switch to
> Cairo???

Just a quick update:  My drawing-area widget based on Tamas Papp's  
cl-cairo2 works well by now.  There is a couple of minor things I'd like  
to fix before publishing the diff.  If you're interested in checking out  
the current version, let me know.

Features include:
- drawing primitives (arcs, lines, rectangles etc.) are CLOS objects in  
their own right and can be manipulated by changing their properties
- currently supported primitives inlclude lines, arcs, rectangles, paths,  
text
- primitives can be easily combined to create more complex structures (as  
an example I included an arrow-primitive, built from a line and a filled  
path)
- primitives have a mouse-over-p property which can be used to create  
hover effects (just set the initform for a primitive's rgb to somthing  
like (c? (if (mouse-over-p self) *red* *black*)))
- primitives are clickable and draggable.  The widget has slots for  
callback functions which can be used to handle these events.
- a set of macros to easily define your own primitives

My todo list includes the following:
- update the code to use the current cl-cairo2 version (currently it is  
built on Tamas' first realease) (medium)
- inlucde methods to export the current state of the widget to svg, ps, or  
png files (easy)
- some internal refactoring (my defprimitive macro does a couple of things  
which deserve existence outside the drawing-area) (easy)

>  Also, ideally, we'd add example code to the test-gtk demo,
> as yet another tab in the notebook.

oh, and of course this one is on the todo list, too.  So far, I  
implemented a petri-net editor based on my widget.  I will use some of  
this code to show how to programmatically and interactively create  
primitives, modify them, drag'n'drop them etc.

Let me know if your're interested in the current state of development.   
Otherwise I will publsih a patch here by the end of the week if everything  
goes well.

Thanks,
Peter



More information about the cells-gtk-devel mailing list