Re: [Goocanvas-devel] custom item, python issues



It's not that there's anything wrong with it, it's that I can't run it because the required libsvgr-python package doesn't seem to be available on Ubuntu. Just by looking at the source code I cannot tell what I am doing wrong and this example is doing correctly, or if the same problem exists in both programs.

--Brandon

Gian Mario Tagliaretti wrote:
On Mon, Dec 8, 2008 at 6:59 PM, Brandon Lewis
<brandon_lewis berkeley edu> wrote:

Hi Brandon,

I've cc'd goocanvas-list on gnome since we are using that one now.

I am trying to write a custom python canvas item derived from
GoocanvasItemSimple. It overrides the following methods

* do_simple_update
* do_simple_paint
* do_simple_is_item_at

The item displays initially, but if changed(True) is called for any reason, the
item disappears. I am not sure what the true cause is, but in my debugging
efforts I have learned that the item's bounds are all wrong. The boundary
coordinates always increase before every update, no matter what values I
assigned to them in a previous update. I have even tried setting the bounds to
all zeros, just to see what effect this might have.

What I really would like to see is a python example of an item derived from
ItemSimple that also overrides do_simple_{update,paint,is_item_at} so that I can
see if I'm doing something wrong. I have looked at the C code for the Rect item,
and I can't see anything obvious that I am doing wrong.

there is a custom-svg.py example that uses update, paint and
is_item_at, isn't that one useful?
http://svn.gnome.org/viewvc/pygoocanvas/trunk/demo/customs/custom-svg.py?view=markup

cheers



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]