Re: Goocanvas issues



On Sun, 2007-05-20 at 12:57 -0500, Paul Davis wrote:
> > >  I
> > > looked at Gtk::Table and its implementation. It uses a
> > > Table_Helpers::Child class that contains the child-properties
> >
> > It provides access to the children, but not to the child properties, I
> > think. Let's ignore the child properties unless we find they are
> > necessary.
> >
> > It would be nice to have generic child property support for other gtkmm
> > containers.
[snip]
> Got fed up with not having the goocanvas api online so i've posted it
> for now at:
> http://gooey.ecn.uiowa.edu/goocanvas_api/html/
> 
> The list of child properties is on the GooCanvasTable page at:
> http://gooey.ecn.uiowa.edu/goocanvas_api/html/GooCanvasTable.html#id2599395
> 
> I think there was a bit of misscomunication. Generally when I'm trying
> to figure out how to wrap something, I try and find an example in
> Gtkmm. In this case I was using Gtk::Table. This next paragraph is
> only about Gtk::Table.
> 
> Gtk::Table uses a Gtk::Table_Helpers::TableChild class. This class is
> where the child properties can be accessed. This class wraps a Gtk
> object.
> 
> ----
> 
> Now, in GooCanvas. There is no TableChild object for GooCanvasTable.
> Therefore I don't really have the ability to use the Helper class
> (AFAIK).

OK. I think this is a false clue. We really need some kind of generic
child properties API or wrapper-generation system to match the generic
GTK+ child properties API.

> For now I'm going to try and wrap as much as I can, although, the
> child properties seem like the sort of thing that should be used by
> application coders.

Please make sure that this kind of thing is mentioned in a TODO file.

> In other news, is there a decent way of determining when I need to use
> refreturn on  a _get() method? Would I just need to check the C docs
> or source to find if it gets ref'ed before the object is returned?

It's a (not well documented) GTK+ C convention that get functions do not
return a reference, unless they are obviously creating an instance (new
instances always start with a refcount). So 99% of get functions need
refreturn in their _WRAP_METHOD().

For the other 1%, yes, I check the source code. It's one of the things
that makes gtkmm less annoying to use than GTK+.

I've tried to document that here, but it could probably be improved:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/aphs03.html#id2571494

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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