Re: [Vala] Problems with goocanvas bindings
- From: Rodney Lorrimar <rodney rodney id au>
- To: Andreas <tradiaz yahoo de>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Problems with goocanvas bindings
- Date: Thu, 27 Mar 2008 18:45:08 +0900
On Wed, Mar 26, 2008 at 03:47:50PM -0700, Andreas wrote:
Thanks for the hint. Using pointers or at leasst declaring the object in
class scope works. I'm currently trying to create bindings for libccc
which would be an alternative.
That's cool, it would be nice to have bindings for both canvases.
I realised the problem was with the irregular semantics of
goo_canvas_*_new(). If a parent is supplied, goo_canvas_*_new() will
return a "borrowed" reference to the item, i.e. one which is already
counted by the parent, but vala doesn't know this and hence calls
g_object_unref(). If a parent isn't supplied, a full reference is
So at present a vala goocanvas user must always pass null as a parent
to new objects and then call parent.add_child(item, -1).
I have emailed the goocanvas list asking for an alternate set of _new
functions which follow the GTK+ semantics and return a floating
reference to an unparented item. If this is unsuccessful, I can write
a patch for a CCode attribute which will allow the binding to always
pass null as the first parameter.
] [Thread Prev