Re: [pygtk] Overriding GObject methods in Python



Hrvoje Nikšić writes:
I'd like to design GObject classes so that they can be inherited, and
their methods overriden, from Python.
...
Another option would be to forego properties and use a separate vtable
object in the class structure.  The object would encapsulated the
binding of slot to GClosure, and could be exported to Python.  It seems
like reinventing the wheel, though.

The wheel you're reinventing is GObject signals.  Signals handle parameter marshalling and return value demarshalling; class methods are implemented and overridden with class closures.  C++-style behaviour (single dispatch) can be achieved with G_SIGNAL_RUN_FIRST and an accumulator that always returns FALSE.



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