On Wed, Mar 26, 2008 at 05:15:08PM +0100, Murray Cumming wrote:
> On Wed, 2008-03-26 at 16:15 +0100, Rodney Lorrimar wrote:
> > Hi,
> > Firstly, thanks for the awesome canvas widget.
> > I am working on the Vala binding for GooCanvas. Vala bindings are
> > mostly automatically generated and don't allow the use of glue
> > code. Vala automatically handles reference counting, so after a
> > variable goes out of scope its reference count is decremented.
> > As explained in the docs for goo_canvas_*_new(), if a parent is
> > specified it will assume ownership of the new item, otherwise the user
> > must call g_object_unref() himself. This makes it difficult to write
> > the binding.
> goocanvasmm just solves this by not exposing that parameter and always
> passing NULL to goocanvas. It's obviously meant mostly as a convenience
> for C coders anyway, who have to worry about reference counting.
OK I am going down that route. Unfortunately, because Vala is still
under development and the bindings are generated automatically, I need
to make some changes to Vala to achieve this.
> > Is it possible to create another set of functions,
> > e.g. goo_canvas_*_new_orphan(), which create items without a parent,
> > and always return a floating reference? These functions would have the
> > GTK+ reference semantics.
Damon, if you think this might be a somewhat useful addition then I
can prepare a patch.