[pygtk] Re: Unable to wrap enum

Gian Mario Tagliaretti gianmt at gnome.org
Fri Jun 22 20:33:50 WST 2007

2007/6/21, shrivastavavarun a yahoo.co.in <shrivastavavarun a yahoo.co.in>:

Hi Varun,

I'm answering to the list, it's always better to avoid writing at the
private address since the question can be interesting for more people
and it will be always available on our friend google.

> But there r other things i couldn't get like some extern declarations and some functions as
> _glist_to_pylist_objs(),

_glist_to_pylist_objs() it's simply a convenience function, when you
have a GList as return value from the C library and you want to
transform it in a python list of objects.

> PyTypeObject PyGooCanvasBounds_Type

This is the way of creating a new object using python C API, codegen
does not create objects for you if in the C library that part of the
code is a simple structure[1], but it will if the structure has got a
type, IIRC part of this particular piece of code can be now removed
from the bindings since in GooCanvas the Bounds structure became a
GBoxed type, this means that, changing the defs accordingly, codegen
will produce that part of code for us.

(define-boxed Bounds
  (in-module "Goo")
  (c-name "GooCanvasBounds")
  (copy-func "goo_canvas_bounds_ref")
  (release-func "goo_canvas_buonds_unref")

[1] because h2def will not pick it up when parsing the headers.

Gian Mario Tagliaretti

More information about the pygtk mailing list