GNOME Bugzilla – Bug 334986
Make it possible to re-implement interfaces and chain to parent impl.
Last modified: 2006-04-01 18:07:54 UTC
It should be possible to implement GInterfaces in python Simple use case. class MyEntry(gtk.Widget): __gtype_implements__ = (gtk.Editable, ) def do_do_insert_text(self, ...) ... __gtype_implements__ is just an example, maybe not the best syntax, but at least it is consistent with __gsignals__ and __gproperties__. Ultimately, it should be possible to override interfaces and chain to parents. Similar to what GtkFileChooserEntry does. It does not need to be solved in the bug, but the implementation of this bug needs to consider that. Creating your own interfaces is out of the scope for this bug and will probably never be possible (since a C VTable needs to be created) without runtime code generation.
Created attachment 61558 [details] [review] pygobject patch Currently pygtk already supports implementing interfaces, just not re-implementing them. The syntax that already exists to indicate we want to implement an interface is to put the interface in the class base types. The patch adds support for re-implementing interfaces, although it is not much useful without code generator changes that go into pygtk.
Created attachment 61559 [details] [review] pygtk part of the patch
Created attachment 61560 [details] small example