I recently checked in support for the __gsignals__ attribute in
development pygtk. The examples/gobject/signal.py example has been
updated to use the new API.
Also, Tim recently added support for signal class closure
override/chaining in libgobject. When this is fully supported in pygtk,
it will be possible to override the class handler for signals of objects
defined in C. At the moment, I have added support for overriding the
closure, but not for chaining up to the overridden closure.
To override a signal, you just add an entry to __gsignals__ for with the
value set to None or 'override'. For example:
>>> class MyWidget(gtk.Widget):
... __gsignals__ = { 'show': 'override' }
... def __init__(self):
... self.__gobject_init__()
... def do_show(self):
... print "show called"
...
>>> gobject.type_register(MyWidget)
>>> o = MyWidget()
>>> o.show()
show called
>>>
once I have the chaining support done, it will be possible to put in a
"self.chain()" call to call the parent implementation. Once this is
done, and support for GDK_TYPE_RECTANGLE and GTK_TYPE_REQUISITION types
is added, it should be possible to implement new widgets purely in python!
James.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk