From 5e3a4eb1c77121f9db6305aaa3456115255c12db Mon Sep 17 00:00:00 2001 From: James Henstridge Date: Fri, 14 Dec 2001 09:06:09 +0000 Subject: use __gsignals__ notation here. 2001-12-14 James Henstridge * examples/gobject/signal.py: use __gsignals__ notation here. * gobjectmodule.c (create_signal, add_signals): helper routines for handling __gsignals__ attribute of classes. (pyg_type_register): add support for creating signals as part of type registration. --- examples/signal.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/signal.py b/examples/signal.py index c52f0ad..3d72e75 100644 --- a/examples/signal.py +++ b/examples/signal.py @@ -1,14 +1,15 @@ import gobject class C(gobject.GObject): + __gsignals__ = { + 'my_signal': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, + (gobject.TYPE_INT,)) + } def __init__(self): self.__gobject_init__() # default constructor using our new GType def do_my_signal(self, arg): print "C: class closure for `my_signal' called with argument", arg - gobject.type_register(C) -gobject.signal_new("my_signal", C, gobject.SIGNAL_RUN_FIRST, - gobject.TYPE_NONE, (gobject.TYPE_INT, )) class D(C): def do_my_signal(self, arg): -- cgit