Hi,
I would like to create hooks for the class creation routines. Normally a new (GObject)
class is created when gobject.type_register() is called. It would be nice if other
modules can add hooks, so interfaces can be initiated and stuff like that.
For example:
class MyClass(GObject, TreeModel):
def __init__(self):
pass
<implement TreeModel callbacks here>
would be possible. Of course GObject can be replaced by any GObject class.
The module's init function should register its hook:
g_object_type_register_hook (PyType_GtkTreeModel, type_register_callback);
If one of the base classes is GtkTreeModel, call type_register_callback.
This can also be done if some extra initialization is required for specific classes.
(For example DIaCanvas: it uses some extra code to set up callbacks for things like an
update handler.)
The callback should look like this:
Callback (GtkTypeObject *class, GType instance_type);
Where class is the Python class object and instance_type is the accompanying GType.
I'd like to have some comments.
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/