Hi,

I'm working on a python wrapper for DiaCanvas2 (hence the previous
postings ;-) and came up with some thoughts...

First of all: the properties and signal handling in Python is really
neat. But it's screaming for more... Shouldn't it be nice if classes
inherited from GObject (or GTK+ objects or whatever) can override the
methods defined in the *Class structures? I noticed property handling
works nice this way (although it works a little different, so it's not
comparable :-( ).

Inheriting from a GObject, calling __gobject__init__() in the __init__()
method and registering it declaration creates a new GType. It would be
nice if an object could set some custom handlers for *Class methods
itself. In case of a DiaCanvasItem (and GnomeCanvasItem) this would mean
that if you create your own canvas item you can override the default
'update' method by creating a 'on_update' method or something like that
in your python class and PyGTK takes care of the rest.

This creates a few problems:
- what happens if you inherit from a python class which is
  inherited from a GObject class?
- How do we define those handlers?

Next: it would also be very neat if you can inherit from a GObject and a
set of interfaces. E.g.

        class MyClass (GObject, GtkTreeModel):
            def on_get_value(self):         
                pass

The type registration stuff should be able to handle this AFAICS. This
means of course that overriding *Class methods should work properly.

And last: could it be possible to depricate the gobject.type_register()
function? Could it be done during the first call to
GObject.__gobject_init__()? That would make the python code more clean.

I hope I made myself clear ;-) ...

Regards,

Arjan

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to