Inconsistencies with GtkClutter Object Instantiation in Python



Greetings,

I've been porting the clutter-gtk/examples from C to Python as a way to learn the clutter API. In doing so, a number of questions and a few bugs have arisen. 

The main issue I'm seeing is a lack of consistency with object instantiation. In Gtk most objects can be instantiated as you would expect in python, for example: Gtk.Button(). However, GtkClutter and Clutter seem to mostly require usage in the form of: GtkClutter.Embed.new() otherwise crashes can occur, but not in all cases. For instance, GtkClutter.Texture.new() will segfault and GtkClutter.Texture() must be used instead. Should these bugs be filed against pygobject or clutter-gtk? I also have no problem digging into these a bit more to essentially triage them to the right group where it makes sense.

Bugs aside, the pattern of using "<api>_<class>_new_<something>" seems consistent throughout the gnome C API's but does not map well to python. A lot of the instantiation inconsistencies could be remedied with pygobject overrides for GtkClutter and Clutter. But is this something that can be fixed deeper in gobject introspection? Furthermore, I had found mention, while searching, of a Clutter.py override file living in the now deprecated pyclutter lib, but this file no longer seems to exist anywhere. This also raises the question of where files like this should live. Is it the responsibility of pygobject to present a consistent pythonic API for gobject supported libs or the libs themself?

Finally, if the python ports of the clutter-gtk examples are useful to others, does it makes sense to include them with the a source package, and if so, which one: pygobject or clutter-gtk?

Thanks,
-Simon





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