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

Re: [Vala] Problems with goocanvas bindings



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
returned.

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.


Cheers

Rodney


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