Hi,

first of all, you should take a look at GObject Introspection [1], which
which is the modern way to use GObject based libraries (and
applications) from other programming languages. For Python, GI is
provided by PyGObject [2]. Clutter works pretty good with a recent
version of PyObject, but it's not combinable with the "native" PyClutter
bindings. Having that said, the current PyClutter bindings are going to
die in favour of GI with some cosmetic overrides to provide a more
pythonic API.

However, if you still want to use the old-style Python bindings you
should add

 import clutter.Model as PyClutterModel_Type

to your override file. Just take a look at [3] to see how this is done
for some pango types in the PyClutter bindings.


so long

:wq buz


[1] http://live.gnome.org/GObjectIntrospection
[2] http://live.gnome.org/PyGObject
[3] 
http://git.clutter-project.org/bindings/pyclutter/tree/clutter/clutter.override#n91

On Wed, Feb 16, 2011 at 01:03:13PM +1100, Jamie Lennox wrote:
> Hi all,
> 
> I'm working on a clutter app and have created a library in C which
> provides an object based on a ClutterModel which should be used
> outside the library as a ClutterModel.
> 
> I now want to pass this off to a GUI written in python (and i
> haven't written python bindings before) but i'm pretty sure they are
> being generated correctly using the gobject-codegen stuff much of
> which i found in the pyclutter makefiles.
> 
> However when it comes to compiling the generated .c file i get an error:
> 
>    'PyClutterModel_Type' undeclared (first use in this function)
> 
> from the line:
> 
>         pygobject_register_class(d, "NeuraMenuDir",
>    NEURA_TYPE_MENU_DIR, &PyNeuraMenuDir_Type, Py_BuildValue("(O)",
>    &PyClutterModel_Type));
> 
> which appears to say register my type as a subclass of ClutterModel
> from pyclutter which is what i want, but PyClutterModel_Type is not
> provided by the pyclutter headers. So in the vein of pyclutter i
> tried to add:
> 
>    extern PyTypeObject PyClutterModel_Type;
> 
> to the headers section of the override file. This compiles and fails
> at runtime because when i look into the generated pyclutter code,
> PyClutterModel_Type is defined as:
> 
>    PyTypeObject G_GNUC_INTERNAL PyClutterModel_Type;
> 
> and so -explicitly- not exported from the library.
> 
> So the question:
> Does this mean that i cannot extend the ClutterModel from C and
> provide it through pyclutter? This throws a spanner in things and
> multiple days of work out the window.
> 
> Otherwise, where did i go wrong?
> 
> 
> Thanks for your help,
> 
> 
> Jamie Lennox
> 

> _______________________________________________
> clutter-app-devel-list mailing list
lutter works fine with a recent PyGObject [2] version. 

> http://lists.clutter-project.org/listinfo/clutter-app-devel-list


-- 
Multitasking = screwing up several things at once.

GnuPG Fingerprint: 2FFF FC48 C7DF 1EA0 00A0  FD53 8C35 FD2E 6908 7B82

Attachment: signature.asc
Description: Digital signature

_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to