Re: [pygtk] Overriding GObject methods in Python



On Tue, 2006-11-28 at 14:34 +0100, Gustavo J. A. M. Carneiro wrote:
> > The PyGTK approach requires writing a piece of glue C code for
> every 
> > class whose methods need to be overridden.  See the example of 
> > GtkCellRenderer.
> 
>   Yes and no:
> 
>     1- Forget about GenericCellRenderer; it is old code, we have a new
> better way of doing things;

Thanks for the tip; what I didn't get at first is that the
GenericCellRenderer is the exception to the rule.  The PyGTK approach
still requires compilation of new glue C code for each new GObject class
added to the system, but at least the glue C code is (mostly)
autogenerated, so it may be usable for this purpose.

>   The way of the future is the gobject-introspection module, but 
> unfortunately it is taking too long to be picked up by glib 
> developers :-(

I agree that a general introspection facility would definitely resolve
many issues raised by script bindings.  For someone in a position to
design his/her own classes, adding the necessary introspection to the
classes may be the most straightforward path.





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