2006-08-20

gNumExp and GooCanvas

During my vacations, I've been slowly trying to convert my pet project gNumExp to GooCanvas. Previously it was using libnxplot (which I created years before cairo was available) and a my own canvas system. So I've been helping Gian Mario Tagliaretti on python bindings for goocanvas, since I also need them for gnumexp.

goocanvas has some good things:
  • It is fast (for instance it looked much faster than ccc, last time I tried both);
  • It has builtin accessibility and keyboard navigation features (though I haven't yet tapped into these features in my program);
  • It has a rich set of basic shapes that you can use;
  • It is very much language bindings friendly due to extensive use of GObject properties;
Unfortunately I also found some flaws:
  • The model/view split adds too much complexity with very little gain;
  • It doesn't make it easy to draw your own custom shapes, due to 1. model/view split, mandatory use of GInterfaces, lack of signals for customizing the drawing;
  • And the #1 problem, it is difficult or impossible to do proper layout. For instance, I'm stuck in drawing the legend of plots because I do not know how much space a legend items will take, but need to know in order to size the legend rectangle correctly.
The first two problems I can cope with, but I need to solve the third problem. Either I missed something in the API, or I'll have to make myself a new API and submit a patch and hope Damon will accept it. So much work just for a legend *sigh*

No comments: